I'm working in Windows 10 with R 4.1.2 in RStudio 2021.09.2. I'm working with spatial data, both vectors and rasters, but three days ago the command library(raster) started to gave me this warning:
Error: package or namespace load failed for ‘raster’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]): namespace ‘terra’ 1.4-22 loaded, but >= 1.5.12 is required
- I tried to update terra, the update finished successfully but the version remains 1.4-22.
- I tried also to remove the packages (terra, raster, sf), then install again everything, but the error remains.
- Finally, I tried the following:
require(devtools)
install_version("terra", version = "1.5-12", repos = "https://cran.r-project.org/src/contrib/Archive/terra/terra_1.5-12.tar.gz")
but in the end the version is the same, 1.4-22. I tried again:
packageurl <- "https://cran.r-project.org/src/contrib/Archive/terra/terra_1.5-12.tar.gz"
install.packages(packageurl, repos=NULL, type="source")
And nothing changed, unfortunately. Is anyone experimenting something similar? How could I fix this error, in your opinion? There are a lot of packages based on terra and I got stuck because seems that none of them can work without this update. Thank you for your help!