Overview


  • Auto generated table of contents
    {:toc}

本教程参考:Window下安装R和Rstudio

1.安装R

1.1 下载R


你能够从http://mirrors.xmu.edu.cn/CRAN/上下载最新的R.
Path

1.2 安装R


注意: 尽量不要安装到中文路径下, 以后使用时可能会有麻烦

bit

成功

2. 安装RStudio


2.1 下载RStudio


你能够从RStudio官网上下载最新的RStudio.
Path

2.2 安装RStudio


3. 更新R


3.1 Fool Way

  1. 备份你的程序包
    重新安装R软件时可能会把你已经安装的package覆盖, 为了避免,我们需要先进行备份(将library文件夹复制到他处)。

程序包位置:/Library/Frameworks/R.framework/Versions/3.2/Resources/library

如何进入路径

打开finder, 使用⌘(command)+⇧(shift)+G, 输入上面路径就可以进入路径
path2

  1. 重复1.11.2

3.2 The Harder Way


Now we set up the global library for R. More details about this is described in [Tal Galili’s blog post][1]. Although you are using the latest version of R, you can still follow my steps. It will help you set a global library for R. This will prevent some troubles in the future.

Open your R. Run chooseCRANmirror() command line(Type it and hit ENTER) .Choose China(Xiamen).

mirror

Run the following codes line by line.

1
2
source("http://www.r-statistics.com/wp-content/uploads/2010/04/upgrading-R-on-windows.r.txt")
Old.R.RunMe()

oldr

It will ask you whether or not to quit R. Just type n and hit ENTER. Then run New.R.RunMe() just the same way.

Once you have done these, from now on, whenever you want to update to a new version of R in the future, all you will need to do are the following TWO steps:

  1. Download and install the new version of R
  2. Open your new R and run the following codes
1
2
source("http://www.r-statistics.com/wp-content/uploads/2010/04/upgrading-R-on-windows.r.txt")
New.R.RunMe()