Install and Upgrade R on Windows

WISE R CLUB, Xiaojun Sun, 2014.06.20

R is a language and environment for statistical computing and graphics. It is widely used around the world. Here I briefly describe the steps to install and upgrade R for R beginners. This post is written for Windows user. If you use Mac, please search Google for instruction. If you have already installed R on your computer, you can jump to step two.

Step 1: Install R and Rstudio

The latest version of R can be download from CRAN. Rstudio Desktop can be download from it’s official site.

Rstudio

Install R

You should set up a folder named R at the directory where you want to install R in. The path should look like G:\Program Files\R\R-3.1.0 which is shown in the graph below.

installR01

Choose according to you PC operation system.

installR02

If you install it successfully, you open R and will see this:

installR03

Install Rstudio Desktop

Choose directory to install Rstudio.

installRstudion1

Open Rstudio you will see this.

installRstudion2

Step 2: Upgrade R

Now we set up the global library for R. More details about this is described in Tal Galili’s blog post. 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.

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
source("http://www.r-statistics.com/wp-content/uploads/2010/04/upgrading-R-on-windows.r.txt")
New.R.RunMe()

That’s all. I hope it helps. Thank you! O(∩_∩)O

 

Return to the homepage.


WISE R Club project is proudly maintained by XiaojunSun.