r-spatial / gstat

Spatial and spatio-temporal geostatistical modelling, prediction and simulation
http://r-spatial.github.io/gstat/
GNU General Public License v2.0
193 stars 49 forks source link

Using simulation with krigeTg #142

Open wschwanghart opened 1 month ago

wschwanghart commented 1 month ago

I just tried to run a simulation using krigeTg. I called the function like this:

k <- krigeTg(As ~ 1, locations = dfs, newdata = newdata, model = vmf, 
             nmax = 30, nsim = 100, lambda = 0)

where dfs is a sf-object, and newdata is a stars object. The function returned following error

Error in OK@data : 
  no applicable method for `@` applied to an object of class "stars"

Best regards, Wolfgang

edzer commented 1 month ago

This implies that sf and/or stars are not yet supported there; use (for now) as(..., "Spatial") before, and st_as_sf() or st_as_stars() afterwards.