Closed alexyshr closed 1 year ago
Hi Alexys! For krige.cv
you should not pass on a grd
stars object, as you only iterate over the points in ea2
. Does that help?
Many regards, from geopython 2023 this time.
Hi Dr. Edzer.
For sure you will bring lots of new ideas from the Python world to R. Please don't leave R aside. I am following your approach in your book https://r-spatial.org/book/13-Geostatistics.html. I just want to use only sf
and stars
with gstat
. I solved the problem using a data.frame
with x
and y
columns (last line), but it is not that cool!
I hope everything is going well!
Sorry for not providing a reproducible example.
I have a valid point
sf
(ea_sf
) with a spatial column (geometry
). The interpolation grid is a properstars
object (grd
). I was able to dokrige
with them. But thekrige.cv
sends this error:Error in st_sf(x, ..., agr = agr, sf_column_name = sf_column_name) : no simple features geometry column present
.The line that sent the error is:
KO.wav.cv <- gstat::krige.cv(co2~1, ea_sf, grd, model=m.f.wav, nfold=nrow(ea_sf))
.This line works ok:
KO.wav.cv <- gstat::krige.cv(co2~1, loc=~ x+y, data=ea2, model=m.f.wav, nfold=nrow(ea2))
.Thank you Dr. Edzer!