How do you install packages in R? (Windows)

  1. Make sure you know the name(s) of your package(s).
  2. Open R. You should see an R Console.
  3. Select Packages from the drop down menu. Choose Install package(s)...
  4. You will be asked to choose a mirror. Choose a location that is near your area. Of course, the default 0-Cloud should be ok.
  5. Click Ok and then Packages will pop up. Select the packages you need.

How do you install packages in R? (macOS)

  1. Make sure you know the name(s) of your package(s).
  2. Open R. You should see an R Console.
  3. Select Packages & Data from the drop down menu. Choose Package Installer.
  4. You will be asked to choose the Packages Repository and Install Location.

How do you load packages in R? (Windows and macOS)

  1. Make sure you know the name(s) of your package(s). Suppose the name is name-of-package.
  2. Open R. You should see an R Console.
  3. Type in library(name-of-package) and press enter.
  4. If you encounter an error, it is likely you have not installed the package. You may encounter warnings, but these depends on the package.