Install packages does not work: Permission denied - r

I'm struggling to install the package "psych".
I started to use the command install.packages("psych"). The download started and the result was the following:
Installing package into ‘C:/Users/Username/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
also installing the dependency ‘mnormt’
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/mnormt_1.5-5.zip'
Content type 'application/zip' length 373388 bytes (364 KB)
downloaded 364 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/psych_1.8.4.zip'
Content type 'application/zip' length 5741178 bytes (5.5 MB)
downloaded 5.5 MB
Error in install.packages : cannot open file 'C:/Users/Username/Documents/R/win-library/3.5/file41147bc27f90/mnormt/CITATION': Permission denied
After that I searched for results. I disabled my firewall. Also I started RStudio with admin rights. A Suggestion was to install the package in R (not R Studio)
There I tried to install it again. The outcome was the following:
Installing package into ‘C:/Users/Username/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
also installing the dependency ‘mnormt’
trying URL 'https://cran.uni-muenster.de/bin/windows/contrib/3.5/mnormt_1.5-5.zip'
Content type 'application/zip' length 373388 bytes (364 KB)
downloaded 364 KB
trying URL 'https://cran.uni-muenster.de/bin/windows/contrib/3.5/psych_1.8.4.zip'
Content type 'application/zip' length 5741178 bytes (5.5 MB)
downloaded 5.5 MB
Error in unzip(zipname, exdir = dest) :
cannot open file 'C:/Users/Username/Documents/R/win-library/3.5/file40fc713ca07/mnormt/CITATION': Permission denied
Do you have any other idea how to fix that? Is there something wrong with the unzip-program?

Can you do .libPaths() ?
Maybe the .libPaths() doesnt map the correct location (if you are not the administrator)
Try .libPaths(.libPaths()[2]) then try install.packages("psych") again.

Related

why am i not able to install any package?

since 2 days ago Whenever i try to insrall a package R gives me this error:
package installation in ‘C:/Users/Win10/AppData/Local/R/win-library/4.2’
(because ‘lib’ is not specified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.2/dplyr_1.0.10.zip'
Content type 'application/zip' length 1306071 bytes (1.2 MB)
downloaded 1.2 MB
package ‘dplyr’ opened with success with sum cntrol MD5
Error in install.packages : ERROR: faild change lock for the directory ‘C:\Users\Win10\AppData\Local\R\win-library\4.2’
Removal ‘C:\Users\Win10\AppData\Local\R\win-library\4.2/00LOCK’
i try to reinstall R and to remove "00LOCK"

Trouble installing glmmTMB

I was using glmmTMB on a cluster. It was working for several weeks. I logged on today and it says I need to install glmmTMB. So, I tried that, but R is giving me the error below.
The main part says: failed to lock directory.
Thanks for any advice.
Installing package into ‘/home/xxxxxx/R/x86_64-redhat-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/glmmTMB_1.1.2.3.tar.gz'
Content type 'application/x-gzip' length 3910643 bytes (3.7 MB)
==================================================
downloaded 3.7 MB
ERROR: failed to lock directory ‘/home/xxxxxx/R/x86_64-redhat-linux-gnu-library/4.0’ for modifying
Try removing ‘/home/xxxxxx/R/x86_64-redhat-linux-gnu-library/4.0/00LOCK-glmmTMB’
Warning in install.packages :
installation of package ‘glmmTMB’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpYJgfa7/downloaded_packages’

Fail to install the "tidyverse" package

I am creating a plot using the ggplot() function in R Studio. For doing the job, I need to install the "tidyverse" package, but find installation failure. I will appreciate if you could solve the problem. The error messages are displayed in the console pane:
install.packages("tidyverse")
Installing package into ‘C:/Users/cheol/OneDrive/문서/R/win-library/3.6’
(as ‘lib’ is unspecified)
also installing the dependency ‘purrr’
trying URL 'https://cran.cnr.berkeley.edu/bin/windows/contrib/3.6/purrr_0.3.3.zip'
Content type 'application/zip' length 426130 bytes (416 KB)
downloaded 416 KB
trying URL 'https://cran.cnr.berkeley.edu/bin/windows/contrib/3.6/tidyverse_1.3.0.zip'
Content type 'application/zip' length 440226 bytes (429 KB)
downloaded 429 KB
package ‘purrr’ successfully unpacked and MD5 sums checked
Error in install.packages : ERROR: failed to lock directory ‘C:\Users\cheol\OneDrive\문서\R\win-library\3.6’ for modifying
Try removing ‘C:\Users\cheol\OneDrive\문서\R\win-library\3.6/00LOCK’

can't install "CHAID" on Mac OS X 10.9.5

I have encountered a problem of installing CHAID package on my Mac. I am not sure if it is a problem of my Mac OS version or some other problems. Could anyone help?
Thank you so much!!
install.packages("CHAID", repos="http://R-Forge.R-project.org")
Warning in install.packages :
cannot open: HTTP status was '404 Not Found'
Warning in install.packages :
cannot open: HTTP status was '404 Not Found'
Warning in install.packages :
unable to access index for repository http://R-Forge.R-project.org/bin/macosx/mavericks/contrib/3.1
package ‘CHAID’ is available as a source package but not as a binary
Warning in install.packages :
package ‘CHAID’ is not available (for R version 3.1.2)
You first need to install the 'partykit' package (and all of its dependincies) and then issue this command:
install.packages("CHAID", repos="http://R-Forge.R-project.org", type="source")
This is the transcript on a Yosemite machine but I think this should also succeed on Mavericks. (You can notice that there is no invocation of compiled code, so I do not need to warn you that XCode might be needed.)
> install.packages("CHAID", repos="http://R-Forge.R-project.org", type="source")
Warning: dependency ‘partykit’ is not available
trying URL 'http://R-Forge.R-project.org/src/contrib/CHAID_0.1-1.tar.gz'
Content type 'application/x-gzip' length 356348 bytes (347 KB)
opened URL
==================================================
downloaded 347 KB
ERROR: dependency ‘partykit’ is not available for package ‘CHAID’
* removing ‘/Library/Frameworks/R.framework/Versions/3.1/Resources/library/CHAID’
The downloaded source packages are in
‘/private/var/folders/yq/m3j1jqtj6hq6s5mq_v0jn3s80000gp/T/RtmpMD0mfx/downloaded_packages’
Warning message:
In install.packages("CHAID", repos = "http://R-Forge.R-project.org", :
installation of package ‘CHAID’ had non-zero exit status
also installing the dependencies ‘RWekajars’, ‘pmml’, ‘strucchange’, ‘mlbench’, ‘RWeka’, ‘psychotools’, ‘psychotree’
trying URL 'http://cran.cnr.Berkeley.edu/bin/macosx/mavericks/contrib/3.1/RWekajars_3.7.12-1.tgz'
Content type 'application/x-gzip' length 6562134 bytes (6.3 MB)
opened URL
==================================================
downloaded 6.3 MB
trying URL 'http://cran.cnr.Berkeley.edu/bin/macosx/mavericks/contrib/3.1/pmml_1.4.2.tgz'
Content type 'application/x-gzip' length 184357 bytes (180 KB)
opened URL
==================================================
downloaded 180 KB
trying URL 'http://cran.cnr.Berkeley.edu/bin/macosx/mavericks/contrib/3.1/strucchange_1.5-0.tgz'
Content type 'application/x-gzip' length 784786 bytes (766 KB)
opened URL
==================================================
downloaded 766 KB
trying URL 'http://cran.cnr.Berkeley.edu/bin/macosx/mavericks/contrib/3.1/mlbench_2.1-1.tgz'
Content type 'application/x-gzip' length 1021909 bytes (997 KB)
opened URL
==================================================
downloaded 997 KB
trying URL 'http://cran.cnr.Berkeley.edu/bin/macosx/mavericks/contrib/3.1/RWeka_0.4-24.tgz'
Content type 'application/x-gzip' length 533932 bytes (521 KB)
opened URL
==================================================
downloaded 521 KB
trying URL 'http://cran.cnr.Berkeley.edu/bin/macosx/mavericks/contrib/3.1/psychotools_0.4-0.tgz'
Content type 'application/x-gzip' length 353913 bytes (345 KB)
opened URL
==================================================
downloaded 345 KB
trying URL 'http://cran.cnr.Berkeley.edu/bin/macosx/mavericks/contrib/3.1/psychotree_0.15-0.tgz'
Content type 'application/x-gzip' length 257879 bytes (251 KB)
opened URL
==================================================
downloaded 251 KB
trying URL 'http://cran.cnr.Berkeley.edu/bin/macosx/mavericks/contrib/3.1/partykit_0.8-4.tgz'
Content type 'application/x-gzip' length 1194059 bytes (1.1 MB)
opened URL
==================================================
downloaded 1.1 MB
The downloaded binary packages are in
/var/folders/yq/m3j1jqtj6hq6s5mq_v0jn3s80000gp/T//RtmpMD0mfx/downloaded_packages
> install.packages("CHAID", repos="http://R-Forge.R-project.org", type="source")
trying URL 'http://R-Forge.R-project.org/src/contrib/CHAID_0.1-1.tar.gz'
Content type 'application/x-gzip' length 356348 bytes (347 KB)
opened URL
==================================================
downloaded 347 KB
* installing *source* package ‘CHAID’ ...
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (CHAID)
The downloaded source packages are in
‘/private/var/folders/yq/m3j1jqtj6hq6s5mq_v0jn3s80000gp/T/RtmpMD0mfx/downloaded_packages’
>

there is no package called 'BiocInstaller'

Whenever I try to install a new package I'm getting this error:
source("http://bioconductor.org/biocLite.R")
Warning in install.packages :
package ‘BiocInstaller’ is not available (for R version 3.0.2 RC)
Installing package into ‘/home/hd-master/R/x86_64-unknown-linux-gnu-library/3.0’
(as ‘lib’ is unspecified)
trying URL 'http://www.bioconductor.org/packages/2.13/bioc/src/contrib/BiocInstaller_1.12.0.tar.gz'
Content type 'application/x-gzip' length 13509 bytes (13 Kb)
opened URL
==================================================
downloaded 13 Kb
Error in library(BiocInstaller) :
there is no package called 'BiocInstaller'
Execution halted
Install R-3.0.2 (not RC).
Try starting R as follows: R --vanilla
See if you are pointing to a weird mirror. What is the output of getOption("repos")?
Try this: install.packages("BiocInstaller", repos="http://bioconductor.org/packages/2.13/bioc")

Resources