[R-sig-Geo] Spatio Temporal Kriging

Raphael Saldanha r|@@|d@nh@ @end|ng |rom gm@||@com
Mon Jul 12 15:35:19 CEST 2021


Hi!

Assuming that you are using the gstat package, looks like that the error occurs when you try to attribute c("Long", "Lat”) to coordinates function.

Try to follow the example from the ?krige function (bellow) with your data:

library(gstat)
library(sp)

data(meuse)
coordinates(meuse) = ~x+y
data(meuse.grid)
gridded(meuse.grid) = ~x+y
m <- vgm(.59, "Sph", 874, .04)

# ordinary kriging:
x <- krige(log(zinc)~1, meuse, meuse.grid, model = m)



Best,

Raphael Saldanha

> Em 12 de jul. de 2021, à(s) 10:25, wycliff mwania <mwaniahwycliff using gmail.com> escreveu:
> 
> Hey there,
> I am doing kriging in R language and am facing some problems when I reach
> the for using the grid.
> When I run this code:
> ```{r}
> coordinates(grid.ST) <- c("Long", "Lat")
> july.kriged <- krige(log(WaterLevel) ~ 1, July, grid.ST, model=july.fit)
> ```
> I get this error:
> Error in (function (classes, fdef, mtable) : unable to find an inherited
> method for function ‘coordinates<-’ for signature ‘"STF"’
> I really do not understand what is happening.
> Also, when I plot my interpolation results, I get blank plot but the scale
> is shown.
> Kindly help.
> Thank you in advance.
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4908 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20210712/24ed5ea3/attachment.p7s>


More information about the R-sig-Geo mailing list