Installing an R package from local unzipped folder

Edward Tyler picture Edward Tyler · Apr 1, 2017 · Viewed 36.6k times · Source

I am having difficulty installing an unzipped package on a Windows 7 computer without administrative privileges and no internet access. I am using the RGui (not RStudio).

Right now I have an unzipped library sitting in a directory. Unfortunately, when I try:

install.packages("C://path//to//directory", 
    repos = NULL, 
    lib = "C://path//to//newDirectory")

I am getting the error:

Warning in `install.packages("C://path//to//directory",`   :
   'lib = "C://path//to//newDirectory"' is not writable

Which is strange because I do have write privileges to where I am attempting to store the package.

When I get this error, I also get a popup from RGui:

Would you like to use a personal library instead?

If I click Yes, it throws the error:

Error in `install.packages("C://path//to//directory",`   :
    type == "both" cannot be used with 'repos = NULL'

I also cannot install devtools. Any ideas?

Answer

Logit picture Logit · May 27, 2018

The solution to installing a package that's been unzipped into a folder is as follows:

install.packages("C:/path to folder with the package", 
repos = NULL, 
type = "source")