long 0-360, shift to -180 to 180
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
-----Original Message----- From: r-sig-geo-bounces at r-project.org [mailto:r-sig-geo-bounces at r- project.org] On Behalf Of Tom Gottfried Sent: Wednesday, March 09, 2011 1:40 PM To: r-sig-geo at r-project.org Subject: Re: [R-sig-Geo] predicting values from variofit function Hi Anna, Am 09.03.2011 21:25, schrieb Anna Gretschel:
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.
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.
Does anyone know wether this works and if it does how to do it?
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
Thanks a lot! Anna
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo