I am trying to install packages in RStudio but just cannot do it. It has been failing to install packages withour errors or warnings.
I had a problem earlier on to install texlive-full earlier on, and might have done something awkward to my /etc/apt/sources.list.d files. I had the following problem:
install.packages('rstanarm')
Warning in install.packages :
unable to access index for repository https://cloud.r-
project.org/src/contrib:
cannot open URL 'https://cloud.r-project.org/src/contrib/PACKAGES
Which was solved in another stackoverflow thread: Unable to install packages in latest version of RStudio and R Version.3.1.1
Upon running: install.packages('rstanarm', dependencies = T, , repos='http://cran.rstudio.com/')
R fails with error:
ERROR: failed to lock directory ‘[...]/R/x86_64-pc-linux-gnu-
library/3.6’ for modifying
Try removing ‘[...]/R/x86_64-pc-linux-gnu-library/3.6/00LOCK-
rstanarm’
Once again, in stackoverflow I tried R install.packages returns "failed to create lock directory"
And running
install.packages('rstanarm', dependencies = T, ,
repos='http://cran.rstudio.com/', INSTALL_opts = c('--no-lock'))
Leads to RStudio crashing and closing in the middle of the installation.
This also happens for other packages. I have spent a few hours on this and on the brink of giving up. Anyone has an idea of what might be going on?
Thank you very much!