Error: Running Raster version

Hello

I recently installed both R and R Studio (this to say everything is updated). And it is giving me a version error when I run the following:

library(raster)

The error is the following:

Loading required package: sp
Error: package or namespace load failed for ‘raster’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
 namespace ‘terra’ 1.4-22 is being loaded, but >= 1.5.12 is required

I already ran "install.packages("raster",dependencies=T)" to install the packages, but the error has to do with the versions. Again, everything is up to date.

Hope someone can help!

The error report says that you need to update the {terra} package from 1.4-22 to 1.5.12. Have you tried that?

1 Like

I did.

But no matter how I install it, it always has the 1.4

The update for {terra} to 1.5.12 from 1.4-22 was released on January 13 and it has been slow to appear as compiled binaries, which means that if you have not installed the tools to compile R packages (e.g., the Rtools4 software for Windows) it will not be possible to install 1.5.12 yet. The binaries for R 4.1 and 4.0 for Windows are not on CRAN. For macOS, they just appeared today.

1 Like

I get another error when I try to install Rtools:

Warning in install.packages :
  package ‘Rtools’ is not available for this version of R

A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages

RTools is a separate software that you have to install in your system (not an R package). You can download it from here:

https://cran.r-project.org/bin/windows/Rtools/rtools40.html

I had the same problem, to fix it use this:

To work with rasters in R, we need two key packages, sp and raster . To install the raster package you can use install.packages('raster') . When you install the raster package, sp should also install. Also install the rgdal package install.packages('rgdal') . Among other things, rgdal will allow us to export rasters to GeoTIFF format.

You can read this in this link: Raster Data in R - The Basics | NSF NEON | Open Data to Understand our Ecosystems.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.