Simen Fjælberg
Simen Fjælberg

Reputation: 31

How can I load the spData-package?

I want to load in the map data, which is found in spData.

  1. I tried to install the package:
    install.packages("spData")
  1. Then I tried to load the package:
    library(spData)

When I do this I get the following error:

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

How do I solve this?

Upvotes: 1

Views: 877

Answers (1)

Robert Hijmans
Robert Hijmans

Reputation: 47146

This is probably because you have a version or raster that is ahead of the version of terra that it requires, caused by a temporary glitch at CRAN with the binary versions for Windows. The easiest way around this problem is to install the development version of terra, and then reinstall raster:

install.packages('terra', repos='https://rspatial.r-universe.dev')
install.packages('raster')

Upvotes: 2

Related Questions