Re: [R] Resampling a grid to coarsen its resolution
That sounds like a sensible way of dealing with the - values... ...but doesn't solve the more important question of how to perform the resampling. Are there are functions in R which have been designed to achieve this? Or is there a standard way of going about this? Many thanks for any advice, Steve _ Send us your Hotmail stories and be featured in our newsletter __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Resampling a grid to coarsen its resolution
Steve Murray-2 wrote: > > Dear all, > > I have a grid (data frame) dataset at 0.5 x 0.5 degrees spatial resolution > (720 columns x 360 rows; regular spacing) and wish to coarsen this to a > resolution of 2.5 x 2.5 degrees. A simple calculation which takes the mean > of a block of points to form the regridded values would do the trick. > Values which should be excluded from the calculation are - (unless all > points within a block are -, in which case - should be returned as > the 'new' cell). > > How would I go about achieving this in R? > > Any help or guidelines would be very much appreciated. > > Many thanks, > > Steve > Check out interp.surface.grid() in the fields package. I would also recommend replacing your - values with NAs so they don't introduce distortion on the edge of your grid during the interpolation. -- View this message in context: http://n4.nabble.com/Resampling-a-grid-to-coarsen-its-resolution-tp1474630p1475406.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Resampling a grid to coarsen its resolution
One possibility I can see is to replace - by NA and use mean with na.rm=TRUE. --- On Wed, 10/2/10, Steve Murray wrote: > From: Steve Murray > Subject: [R] Resampling a grid to coarsen its resolution > To: r-help@r-project.org > Received: Wednesday, 10 February, 2010, 3:20 AM > > Dear all, > > I have a grid (data frame) dataset at 0.5 x 0.5 degrees > spatial resolution (720 columns x 360 rows; regular spacing) > and wish to coarsen this to a resolution of 2.5 x 2.5 > degrees. A simple calculation which takes the mean of a > block of points to form the regridded values would do the > trick. Values which should be excluded from the calculation > are - (unless all points within a block are -, in > which case - should be returned as the 'new' cell). > > How would I go about achieving this in R? > > Any help or guidelines would be very much appreciated. > > Many thanks, > > Steve > > > > > > > _ > Got a cool Hotmail story? Tell us now > > __ > R-help@r-project.org > mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, > reproducible code. > __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Resampling a grid to coarsen its resolution
Dear all, I have a grid (data frame) dataset at 0.5 x 0.5 degrees spatial resolution (720 columns x 360 rows; regular spacing) and wish to coarsen this to a resolution of 2.5 x 2.5 degrees. A simple calculation which takes the mean of a block of points to form the regridded values would do the trick. Values which should be excluded from the calculation are - (unless all points within a block are -, in which case - should be returned as the 'new' cell). How would I go about achieving this in R? Any help or guidelines would be very much appreciated. Many thanks, Steve _ Got a cool Hotmail story? Tell us now __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.