【R】Mac 中打开 R 后显示红色 Waring

打开 R 后显示红色 Waring :

During startup - Warning messages:
  1: Setting LC_CTYPE failed, using "C"
  2: Setting LC_COLLATE failed, using "C"
  3: Setting LC_TIME failed, using "C"
  4: Setting LC_MESSAGES failed, using "C"
  5: Setting LC_PAPER failed, using "C"
  [R.app GUI 1.50 (6126) x86_64-apple-darwin9.8.0]  
    WARNING: You are using a non-UTF8 locale, therefore only ASCII characters will work.  
    Please read R for Mac OS X FAQ (see Help) section 9 and adjust your system 
    preferences accordingly.  [History restored from /Users/mohammadgoodarzi/.Rapp.history]

处理方法:

首先在 R 中输入:

system("defaults write org.R-project.R force.LANG en_US.UTF-8")

然后在 系统终端中输入:

defaults write org.R-project.R force.LANG en_US.UTF-8

原因是系统 Shell 下的 locale 设置错误造成的,但是,你在 .bash_profile 或者 .bashrc 里设置 export LANGexport LC_ALL 都不是很管用

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 官网 中文版本 好的网站 Content-type: text/htmlBASH Section: User ...
    不排版阅读 4,533评论 0 5
  • 1、bash 与 shell 管理整个计算机硬件的其实是操作系统的内核(Kernel),这个内核是需要被保护的,所...
    Zhang21阅读 881评论 0 2
  • 一、Ubuntu系统环境变量配置文件 Ubuntu 系统环境变量配置文件分为两种:系统级文件和用户级文件,下面详细...
    Fanzone阅读 872评论 0 2
  • 安装 初始化 在go项目的根目录下直接运行: 添加依赖 glide get,类似于go get,不过不同的是,gl...
    TomorrowWu阅读 857评论 1 1
  • 放射科第一个上午,找大爷报道。然后,签字,取工号,跟老师学读片。学会了一些常见的胸片,气胸是彻底记住了,被...
    王翊茗阅读 219评论 0 0