简体   繁体   中英

R in command line not installing packages

R in command line is not installing any packages. Have tried changing repos but packages do not stay installed. Everything works fine in Rstudio. This is an issue for when working with mapDamage

Have changed the repository. Uninstalled and reinstalled R multiple times.

> install.packages("gam")
Installing package into ‘/home/gf/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
Warning: unable to access index for repository https://cloud.r-project.org/src/contrib:
  cannot open URL 'https://cloud.r-project.org/src/contrib/PACKAGES'
Warning message:
package ‘gam’ is not available (for R version 3.4.4) 

Changed the repository to " http://cran.rstudio.com " and it can install but as soon as I leave the R window it reverts back to the original repository and no longer works.

You could try a different CRAN mirror

eg

options(repos=structure(c(CRAN="https://cran.csiro.au/")))

Then try to install?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM