r - 使用自制软件安装 R 后的终端
问题描述
按照此处的说明在 mac 上使用 homebrew 安装 R 后: https ://www.datacamp.com/community/tutorials/installing-R-windows-mac-ubuntu 。当我打开终端时,我得到这些:
-bash: /Users/myname/.bash_profile: line 27: syntax error near unexpected token `category="LC_ALL",'
-bash: /Users/myname/.bash_profile: line 27: `Sys.setlocale(category="LC_ALL", locale = "en_US.UTF-8")'
那么我怎样才能修复/摆脱这些出现在终端上的问题。
我认为这与以下内容有关:
$ echo "export LC_ALL=en_US.UTF-8" >> ~/.bash_profile
$ echo "export LANG=en_US.UTF-8" >> ~/.bash_profile
$ echo "export PATH=/usr/local/bin:$PATH" >> ~/.bash_profile && source ~/.bash_profile
解决方案
您链接的说明在步骤 3 中执行此操作以将内容添加到您的~/.bash_profile
:
echo 'Sys.setlocale(category="LC_ALL", locale = "en_US.UTF-8")' >> ~/.bash_profile
我认为这是错误的。那是 R 代码,而不是 bash 代码,所以它不应该进入~/.bash_profile
. 它应该进去~/.Rprofile
。
从您的文件中删除第 27 行(上面写着Sys.setlocale(...)
)~/.bash_profile
并将其添加到您的~/.Rprofile
文件中。
然后向 DataCamp 发送一封电子邮件,告诉他们他们的 R 安装说明中存在重大错误。
推荐阅读
- c# - 是否可以对整个文档应用 VS2019 建议
- kubernetes - 将数据导入 Neo4j Kubernetes 集群
- jenkins-pipeline - 检查 npx 命令是否失败
- node.js - 读取文件,然后使用 node.js 删除文件
- binding.scala - Binding.scala:Vars.bind 似乎无法正常工作
- html - 如何在 Laravel 5.8 的 Blade 视图中动态显示多个 PDF 文档
- recursion - 使用递归时如何计算列表(或嵌套列表的列表)中的所有原子
- c# - 高效移动文件
- javascript - FullCalendar - 一天中的半天GridMonth
- java - 如何根据整数的值将整数数组转换为字符串数组?