R freezes in Mac OS X Yosemite

后端 未结 4 705
离开以前
离开以前 2021-01-17 18:32

I encountered this problem and there was no clear explanation about how to work around this bug.

The latest version of R (v. 3.1.2) for OS X Mavericks freezes in Yo

4条回答
  •  佛祖请我去吃肉
    2021-01-17 19:20

    Apparently, this is a bug in R's GUI. Some OS X features/libraries that used to be in place in earlier versions of OS X have been removed in Yosemite.

    You can work around this bug by running R from the terminal / command line. Fire up the terminal app (quickest way is to use Spotlight search: cmd+space -> terminal), and type in (or paste) the following command:

    /Applications/R.app/Contents/MacOS/R
    

    Also avoid using the Misc menu or other GUI elements if you can. Using the change working directory menu entry in the Misc menu causes a freeze. You can use the R command setwd() instead, e.g.:

    setwd("path/to/your/working/directory")
    

    There is a problem though, you have to change your working directory every time you open up R. To make the change permanent, put the above command (setwd) in your R's init file (.Rprofile) in your home directory. If you cannot find .Rprofile, that is fine, create a file in your home directory, name it .Rprofile, and paste the command there. This file is executed by R every time you open up R.

提交回复
热议问题