Download and Install R
Windows:
- go to https://cloud.r-project.org/bin/windows/base/
- click the “Download R 4.4.1 for Windows” link.
- When the file finishes downloading, double-click to install. You
should be able to just click “Next” to all dialogs to finish the
installation.
Mac:
- Go to https://cloud.r-project.org/bin/macosx/
- Click the appropriate “pkg” file for your computer:
- Select “R-4.4.1-arm64.pkg” if you’re using macOS 11 or higher with a
M1/M2 chip.
- Select “R-4.4.1-x86_64.pkg” if you’re using macOS 11 or higher with
an Intel chip.
- If you’re not sure which to choose, visit this page to find
out what kind of operating system and chip set your Mac has.
- When the file finishes downloading, double-click to install. You
should be able to just click “Next” to all dialogs to finish the
installation.
Linux:
- Go to https://cloud.r-project.org/bin/linux/
- Go to the folder that most closely matches your distribution
- Follow the directions to install.
Download and Install RStudio Desktop
- go to https://posit.co/download/rstudio-desktop/
- Click the Blue button under “2: Install RStudio”
- When the file finishes downloading, do what you would normally do to
install a program on your system
- Start RStudio and ensure it opens with no error messages. You should
see something similar to the image below.
NOTE: The current version of RStudio requires macOS
12+. If you are running an older version of macOS, you will
need to download an older version of RStudio from https://docs.posit.co/previous-versions/rstudio/.
See This
post on the RStudio community forum for a list of RStudio releases
certified for each version of MacOS when the operating system was
supported.
Download and Install R Packages
R packages are collections of functions that extend the capabilities
of R. Many packages are available through https://cran.r-project.org/index.html, the Comprehensive
R Archive Network. Below are instructions for installing R packages from
CRAN using RStudio.
- Open RStudio
- In the menu, go to Tools…Install Packages.
- In the Packages field enter the package name(s); separate multiple
packages by space or comma
- Click Install
Update R
You don’t actually “update” R, you install a new version. R is
designed such that multiple versions can be installed side-by-side. If
you only want the latest version of R installed, here’s one approach to
take:
- Uninstall the current version of R on your computer.
- Download the most recent version of R and install it.
- Open RStudio and click the Update button on the Packages tab to
update packages.
Update RStudio
RStudio will usually notify you when updates are available. The
easiest thing to do is to click the “Quit and Download…” button on the
notification and install the new version. Unlike R, this will overwrite
the previous installation with the new installation. This is probably
what you want. Unless you’re a developer, you probably don’t want
multiple versions of RStudio on your computer.
You can also go to “Help…Check for Updates…” to see if there is a new
version of RStudio available.
Update R packages
Many of the more popular R packages are under active development and
updated on a regular basis. To check for and install package
updates:
- Open RStudio
- In the menu, go to “Tools…Check for Package Updates…”
- If new versions are available for packages you already have
installed, they will be presented in a window
- It’s probably easiest to just click Select All and then click
Install Updates. That will update all packages.
- If you get a message that asks “Do you want to install from sources
the packages which need compilation?”, the easiest thing to do is click
No. See this
discussion for an explanation of the difference between clicking Yes
or No.