Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languager
# 1. Install devtools
install.packages("devtools")
# 2. Load R pkg
library(devtools)
# 3. Install a pkg from GitHub
# install_github("username/repo")
install_github("tidyverse/ggplot2")

Installing Packages from a Local

...

File

To install a package manually, place the compressed R package (usually is compressed as a tarball or zip file) inside your R Personal Library (e.g., ~/R-<version_selected>/library) and run the following command:

Code Block
languager
install.packages("pkgName", lib="~/R-<version_selected>/library")

Conversely, you You can also install a an R package via R CMD INSTALL <path-to-tarball>. However, this assumes all dependencies are already installed in your R Personal Library. For example:

...