Skip to content

DS3-2025/installing_updating_R-RStudio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

Getting started with R and RStudio

1. Installing R

a. For Mac OS users, you can download R from CRAN here.

  • For R ≥4.1.0 there is a separate build for ARM-based Macs (also known as ‘M1/M2/M3/M4’ and ‘Apple Silicon’).
  • For packages that require compilation: Xcode Command Line Tools needs to be installed - to install execute the following command in Terminal: xcode-select --install or see here and here. If having gfortran issues on Apple Silicon computers, check out the macrtools R package, or use the gfortran installer linked at the top of this page.

b. For Windows users, you can download R here.

  • For packages that require compilation: see here.

c. For Linux users, you can download R here.

2. Installing RStudio IDE

Download RStudio here

For tips on getting started, see:

3. Updating R and RStudio

For more information on how RStudio and R interact, see here.

a. Mac OS:

  • Simply downloading and installing a new version of R should result in RStudio using the latest version.
  • By default RStudio will run against the current version of R.Framework.
  • List all of the versions of R.Framework on your system and determine which one is considered the current one by executing the following command in Terminal:
      ls -l /Library/Frameworks/R.framework/Versions/
    
  • To change the current version of R.Framework, you can either:
    a. Run the installer from CRAN for the R version you want to be current.
    b. Update the R.framework/Versions/Current directory alias directly using ln -s.
    c. Override the RSTUDIO_WHICH_R environment variable to the R executable that you want to run against (add to ~/.profile file):
      export RSTUDIO_WHICH_R=/usr/local/bin/R
    

b. Windows:

  • You may need to uninstall R to update it.
  • On Windows, RStudio uses the system's current version of R by default.
  • You can override which version of R is used via General panel of the RStudio Options dialog.
  • Another option for Windows users is to use a package called installr

c. Linux:

  • Simply downloading and installing a new version of R should result in RStudio using the latest version.
  • RStudio uses the version of R pointed to by the output of the following command:
      which R
    
  • To override the RSTUDIO_WHICH_R environment variable to the R executable that you want to run against (add to ~/.profile file):
      export RSTUDIO_WHICH_R=/usr/local/bin/R
    

d. Updating RStudio

  • Go to Help > Check for Updates > Quit and Download...
  • Download and install.

Alternatives to running R and RStudio locally

a. Data Studio on the CAVATICA platform (free account required)

b. Posit Cloud (free account required)

Additional requirements

To allow cloning of project repositories from within RStudio, you will need to have Git and (optionally) Git LFS installed on your system.

Git

For details, see here

a. Mac OS:

b. Windows:

  • Download installer here
  • Using WinGet: winget install --id Git.Git -e --source winget

c. Linux:

  • Instructions here
  • Debian/Ubuntu: apt-get install git
  • Fedora/Rocky: dnf install git

Git LFS (large file storage)

OPTIONAL - only required during DS3 course for mass_cytometry_dataviz exercise.
For details, see here

a. Mac OS:

b. Windows:

  • Git LFS is included in the distribution of Git for Windows

c. Linux:

Once installed, set up Git LFS for your user account by running: git lfs install

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors