Promoting the use of R in the NHS

Blog Article

Installation Instructions (Part 1 of 2)

Windows Users

To Install R:

  1. Open an internet browser and go to r-project.org.
  2. Click the “download R” link in the middle of the page under “Getting Started.”
  3. Select a CRAN location (a mirror site) and click the corresponding link.
  4. Click on the “Download R for Windows” link at the top of the page.
  5. Click on the “install R for the first time” link at the top of the page.
  6. Click “Download R for Windows” and save the executable file somewhere on your computer.  Run the .exe file and follow the installation instructions.
  7. Now that R is installed, you need to download and install RStudio.

To Install RStudio

  1. Go to rstudio.com and click on the “Download RStudio” button.
  2. Click on “Download RStudio Desktop.”
  3. Click on the version recommended for your system, or the latest Windows version, and save the executable file.  Run the .exe file and follow the installation instructions.

Mac Users

To Install R

  1. Open an internet browser and go to r-project.org.
  2. Click the “download R” link in the middle of the page under “Getting Started.”
  3. Select a CRAN location (a mirror site) and click the corresponding link.
  4. Click on the “Download R for (Mac) OS X” link at the top of the page.
  5. Click on the file containing the latest version of R under “Files.”
  6. Save the .pkg file, double-click it to open, and follow the installation instructions.
  7. Now that R is installed, you need to download and install RStudio.

To Install RStudio

  1. Go to rstudio.com and click on the “Download RStudio” button.
  2. Click on “Download RStudio Desktop.”
  3. Click on the version recommended for your system, or the latest Mac version, save the .dmg file on your computer, double-click it to open, and then drag and drop it to your applications folder.

https://courses.edx.org/courses/UTAustinX/UT.7.01x/3T2014/56c5437b88fa43cf828bff5371c6a924/

Installation Instructions (Part 2 of 2)

Installing Required Packages

  1.  Open Rstudio (not R) and go to the “Tools” option on the menu bar (Mac users: choose “Not Now” when asked if you want to install developer tools)
  2. Select the option; “Install Packages…”. In the text box for packages type the following (each package name separated by a space);tidyverse readxl lubridate zoo gridExtra padr

  1. Click the Install button (Mac users: again, choose “Not Now” to dev. tools).

Text and progress bars should start appearing on your screen. If you are prompted about installing packages which need compilation, type y and press Enter.

 Note: If the warning and error messages (similar to below) appear, it may be that you do not have administrator privileges enabled. If you have administrator privileges on your machine then you may be able to address this issue with the following steps: Close RStudio, find the RStudio icon again and right click it. Select “Run as administrator”. Confirm that you want this program to make changes to the computer. Repeat the instructions above (Tools –> Install Packages… )

Warning in install.packages :

‘lib = “C:/Program Files/R/R-3.4.0/library”‘ is not writable

“Error in install.packages : unable to install packages”

Once the installation has finished, click beside the command prompt in the Console window (it’s the arrow symbol, > , without text afterward). The cursor should be flashing.

 

 

 

 

 

 

 

 

Type (rather than copy and paste) the following, carefully (it is case sensitive):

tidyverse::tidyverse_lo

At this point the autocomplete feature should provide the option “tidyverse_logo” beneath the text you are typing:

 

 

 

Press Enter to select this option.

Then press Enter to execute the line of code.

You should see the logo (as below), meaning you have successfully installed the tidyverse!

Leave a Reply