R Language Installing packages Install local development version of a package


Example

While working on the development of an R package it is often necessary to install the latest version of the package. This can be achieved by first building a source distribution of the package (on the command line)

R CMD build my_package

and then installing it in R. Any running R sessions with previous version of the package loaded will need to reload it.

unloadNamespace("my_package")
library(my_package)

A more convenient approach uses the devtools package to simplify the process. In an R session with the working directory set to the package directory

devtools::install()

will build, install and reload the package.