alain ponsero
2005-Jun-10 14:16 UTC
[R] In connection with the creation of a grid of point with gstat
Hi ALL, With the pakage gstat How can one create a grid of points as in the meuse.grid example, from measuring sites as in the Meuse example Thanks in advance! Alain PONSERO Conservateur Réserve Naturelle de la Baie de Saint-Brieuc site de l'Etoile 22120 HILLION tel/fax : 02.96.32.31.40 <mailto:aponsero@cabri22.com> aponsero@cabri22.com <http://www.reservebaiedesaintbrieuc.com/reserve.htm> http://www.reservebaiedesaintbrieuc.com/reserve.htm><(((°>[[alternative HTML version deleted]]
Roger Bivand
2005-Jun-10 14:56 UTC
[R] In connection with the creation of a grid of point with gstat
On Fri, 10 Jun 2005, alain ponsero wrote:> > > Hi ALL, > > With the pakage gstat > > > > How can one create a grid of points as in the meuse.grid example, from > measuring sites as in the Meuse example >In the meuse example, the meuse.grid locations are provided. They are essentially the same as the code snippet in the example for predict.gstat(): # unconditional simulation on a 100 x 100 grid xy <- expand.grid(1:100, 1:100) names(xy) <- c("x","y") g.dummy <- gstat(formula = z~1, locations = ~x+y, dummy = TRUE, beta = 0, model = vgm(1,"Exp",15), nmax = 20) yy <- predict(g.dummy, newdata = xy, nsim = 4) that is using expand.grid() and giving the output object the correct names for your coordinates. If you need to mask the grid, you need to choose just some rows of xy for prediction (perhaps using the overlay() method in the sp package).> > > Thanks in advance! > > > > Alain PONSERO > Conservateur > R??serve Naturelle de la Baie de Saint-Brieuc > site de l'Etoile > 22120 HILLION > tel/fax : 02.96.32.31.40 > <mailto:aponsero at cabri22.com> aponsero at cabri22.com > <http://www.reservebaiedesaintbrieuc.com/reserve.htm> > http://www.reservebaiedesaintbrieuc.com/reserve.htm > ><(((??> > > > > [[alternative HTML version deleted]] > >-- Roger Bivand Economic Geography Section, Department of Economics, Norwegian School of Economics and Business Administration, Helleveien 30, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43 e-mail: Roger.Bivand at nhh.no