I tried to install the INLA library automatically. My code ran successfully on my Mac but failed on Windows. Thank you
packages <- c(
"INLA"
)
installed_packages <- packages %in% rownames(installed.packages())
if (any(installed_packages == FALSE)) { install.packages("INLA",repos=c(getOption("repos"),INLA="
https://inla.r-inla-download.org/R/stable"), dep=TRUE)}
invisible(lapply(packages, library, character.only = TRUE))
and I got the error on my windows as follows
* installing *binary* package 'INLA' ...
Warning in system(paste("cp -R .", shQuote(instdir), "|| (", TAR, "cd - .| (cd", :
'cp' not found
ERROR: installing binary package failed
* removing 'C:/Users/tmdgu/AppData/Local/R/win-library/4.3/INLA'
Warning in install.packages :
installation of package ‘INLA’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\tmdgu\AppData\Local\Temp\Rtmpwt8fnT\downloaded_packages’
Error in FUN(X[[i]], ...) : there is no package called ‘INLA’