Search code examples
rinstallationpackagelocal

Install own R package


I want to install a local package. I tried:

install.packages("C:/Users/Name/Dropbox...Rpackage/", repos = NULL, type="source")

which results in:

Warning: invalid package 'C:/Users/Name/Dropbox...Rpackage/'
Error: ERROR: no packages specified
Warning in install.packages :
  installation of package ‘C:/Users/Name/Dropbox...Rpackage/’ had non-zero exit status

I will be thankful for advice!


Solution

  • The syntax of your call to install.packages() is incorrect. If you are trying to install a local development package from its source directory (i.e. the folder containing DESCRIPTION, NAMESPACE, R/, etc.) you can either:

    • Navigate to the folder and run devtools::install() or R CMD INSTALL from a terminal.
    • Utilize remotes::install_local() pointing to the directory.