csdnceshi67
bug^君
采纳率25%
2012-03-13 17:35

在 Mac 上安装 r-警告消息: 使用"c"设置 LC ctype 失败

已采纳

I would like install R on my laptop Mac OS X version 10.7.3

I downloaded the last version and I double click on it and it was installed, when i start up I get the following error, I searched in internet but I could not solve the problem, any help would be appreciated

the errors are

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're 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/nemo/.Rapp.history]

转载于:https://stackoverflow.com/questions/9689104/installing-r-on-mac-warning-messages-setting-lc-ctype-failed-using-c

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

6条回答

  • weixin_41568196 撒拉嘿哟木头 8年前
    1. Open Terminal
    2. Write or paste in: defaults write org.R-project.R force.LANG en_US.UTF-8
    3. Close Terminal
    4. Start R
    点赞 24 评论 复制链接分享
  • csdnceshi78 程序go 7年前

    I found slightly different problem running R on through mac terminal, but connecting remotely to an Ubuntu server, which prevented me from successfully installing a library.

    The solution I have was finding out what "LANG" variable is used in Ubuntu terminal

    Ubuntu > echo $LANG
    en_US.TUF-8
    

    I got "en_US.TUF-8" reply from Ubuntu.

    In R session, however, I got "UTF-8" as the default value and it complained that LC_TYPEC Setting LC_CTYPE failed, using "C"

    R> Sys.getenv("LANG")
    "UTF-8"
    

    So, I tried to change this variable in R. It worked.

    R> Sys.setenv(LANG="en_US.UTF-8")
    
    点赞 10 评论 复制链接分享
  • weixin_41568127 ?yb? 7年前

    Setting locales in terminal resolved the issue for me. Open the terminal and

    1. Check if locale settings are missing

      > locale
      LANG=
      LC_COLLATE="C"
      LC_CTYPE="UTF-8"
      LC_MESSAGES="C"
      LC_MONETARY="C"
      LC_NUMERIC="C"
      LC_TIME="C"
      LC_ALL=
      
    2. Edit ~/.profile or ~/.bashrc

      export LANG=en_US.UTF-8
      export LC_ALL=en_US.UTF-8
      
    3. Run . ~/.profile or . ~/.bashrc to read from the file.

    4. Open a new terminal window and check that the locales are properly set

      > locale
      LANG="en_US.UTF-8"
      LC_COLLATE="en_US.UTF-8"
      LC_CTYPE="en_US.UTF-8"
      LC_MESSAGES="en_US.UTF-8"
      LC_MONETARY="en_US.UTF-8"
      LC_NUMERIC="en_US.UTF-8"
      LC_TIME="en_US.UTF-8"
      LC_ALL="en_US.UTF-8"
      
    点赞 2 评论 复制链接分享
  • csdnceshi71 Memor.の 7年前

    Just open the R(software) and copy and paste

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

    Hope this will work fine or use the other method

    open(on mac): Utilities/Terminal copy and paste
    
    defaults write org.R-project.R force.LANG en_US.UTF-8
    

    and close both terminal and R and reopen R.

    点赞 1 评论 复制链接分享
  • csdnceshi52 妄徒之命 4年前

    On my Mac r is installed in /usr/local/bin/r, add line below in .bash_profile solved the same problem:

    alias r="LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 r"
    
    点赞 评论 复制链接分享
  • csdnceshi75 衫裤跑路 3年前

    Tks Ramon Gil Moreno. Pasting in Terminal and then restarting R Studio did the trick:
    write org.rstudio.RStudio force.LANG en_US.UTF-8

    Environment: MAC OS High Sierra 10.13.1 // RStudio version 3.4.2 (2017-09-28) -- "Short Summer"

    Ennio De Leon

    点赞 评论 复制链接分享

相关推荐