Skip to content

predicting values from variofit function

3 messages · Anna Gretschel, Tom Gottfried, Andy Bunn

#
Dear List,

I have fitted a spherical function to my variogram using "variofit(...)" 
from GeoR. Now I would like to predict some data with the function 
"predict(object,...)" from package stats. Does anyone know wether this 
works and if it does how to do it?

Thanks a lot!
Anna
#
Hi Anna,

Am 09.03.2011 21:25, schrieb Anna Gretschel:
Note that predict() is a generic function (see
http://cran.r-project.org/doc/manuals/R-intro.html#Object-orientation). 
I don't think there is a method in geoR that does what you want.
The package gstat has a method for objects of class gstat (see ?gstat, 
?predict.gstat and the ASDAR book). You can coerce your variogram fit 
from geoR to the respective class used in package gstat with 
as.vgm.variomodel(). You can do kriging with krige.conv() from geoR too. 
But I think you have more options in gstat.

regards,
Tom
#
I have a raster with longitude data over 0 to 360.

bar <- raster(t(foo[,,1]),xmn=0,xmx=356.25,ymn=-87.159094555863,ymx=87.159094555863,
              crs="+proj=longlat +datum=WGS84")

I'd like to shift those longitudes to -180 to 180. I tried paying with the +long_wrap argument to crs but to no avail. Can somebody help? I'll need to overlay and extract data from the negative side (e.g., 100W or -100) and it would be nice to have the coordinates the same.

Thanks in advance, 
Andy