[R-sig-Geo] Data grid in kriging?
Jon Olav Skoien
jon.skoien at jrc.ec.europa.eu
Thu Jul 12 10:25:03 CEST 2012
You may be able to create a SpatialGridDataFrame from
SpatialPolygonsDataFrame, but it depends on your polygon file. Are the
polygons referring to the boundaries of grid cells? If sp0 is the
SpatialPolygonsDataFrame you will probably get what you want with
(untested):
sp1 = SpatialPointsDataFrame(coordinates(sp0), data = sp0 at data)
gridded(sp1) = TRUE
fullgrid(sp1) = TRUE
But I am not sure if this is what you should do in your case. I do not
see any reference to a shape file in demo(krige), anyway, R does not
care about how your data are stored outside R, only what type of spatial
data it is (grid, points, polygons, lines), and whether the format can
actually be read into R. meuse.grid is a grid, but you can also predict
to points not being on a grid, or to polygons. Your observations can be
points or a grid. The .grid extension of meuse.grid is just for
convenience to show what kind of data you are working with, the name
could also be meusePred or something completely else
If this does not help you, then try to describe your problem in more
detail, what sort of data you have and what you would like to do with them.
Best wishes,
Jon
On 11-Jul-12 20:18, riaarinda wrote:
> specifically, what I ask is "How to create SpatialGridDataFrame from
> SpatialPolygonsDataFrame" ?
On 11-Jul-12 16:43, riaarinda wrote:
> Currently I am trying to do kriging function in R. When I see the demo(krige)
> in R, there are 2 data used. *.shp and *.grid. Can I use kriging when I only
> have shape file (*.shp)? What is data.grid actually and can I create the
> grid from shp file I have?
> Thank you
>
> --
> View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Data-grid-in-kriging-tp7580428.html
> Sent from the R-sig-geo mailing list archive at Nabble.com.
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
--
Jon Olav Skøien
Joint Research Centre - European Commission
Institute for Environment and Sustainability (IES)
Land Resource Management Unit
Via Fermi 2749, TP 440, I-21027 Ispra (VA), ITALY
jon.skoien at jrc.ec.europa.eu
Tel: +39 0332 789206
Disclaimer: Views expressed in this email are those of the individual and do not necessarily represent official views of the European Commission.
More information about the R-sig-Geo
mailing list