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")
Answer from Logit on Stack OverflowThe 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")
I was able to do this using devtools:
devtools::install("path/to/package/folder")
install.packages - How do I install an R package from source? - Stack Overflow
How can I change the default package installation folder for multiple versions of R?
Although this does not specifically answer your question, you could try using the renv package. It sets up a virutal environment, like how you would in Python. Then, within a virtual environment, any packages that you install are local to that virtual environment.
Using a virtual environment is usually good design practice, since it localises and stores the dependencies that you need for each project.
More on reddit.comCan I install (and use) dependencies on a local directory?
Issues with installing packages on work computer (non-admin, OneDrive issues)
If you have the file locally, then use install.packages() and set the repos=NULL:
install.packages(path_to_file, repos = NULL, type="source")
Where path_to_file would represent the full path and file name:
- On Windows it will look something like this:
"C:\\RJSONIO_0.2-3.tar.gz". - On UNIX it will look like this:
"/home/blah/RJSONIO_0.2-3.tar.gz".
Download the source package, open Terminal.app, navigate to the directory where you currently have the file, and then execute:
R CMD INSTALL RJSONIO_0.2-3.tar.gz
Do note that this will only succeed when either: a) the package does not need compilation or b) the needed system tools for compilation are present. See: R for Mac OS X