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?
Go into R, click on Packages (at the top of the R console), then click on "Install package(s) from local zip files", then find the zip file with arm from wherever you just saved it. Do the same thing to install each of the other packages you want to install.
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")
If it is an unzipped Windows binary (e.g., from CRAN), you can just copy and paste the entire package directory into your library folder. You could also, presumably, use file.copy()
to do so if you wanted to do it within R. install.packages()
is failing (weirdly) because you're giving it something other than the typical package source or zipped binary that it is expecting.
I think the error message is actually just wrong. You need to give the file name of the package, not just the directory.
install.packages("C://path//to//directory//MY_PACKAGE.tar.gz",
repos = NULL,
lib = "C://path//to//newDirectory")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With