regrid | R Documentation |
Using spatial interpolation this function transforms a geofield to another geometry.
regrid(infield, newdomain=.Last.domain(),
method="bilin", mask=NULL, newmask=NULL, weights=NULL)
regrid.init(olddomain, newdomain=.Last.domain(),
method="bilin", mask=NULL, newmask=NULL)
infield |
A |
olddomain |
A |
newdomain |
A |
#
... |
Options for |
method |
The interpolation method can be bilinear ("bilin"), bicubic ("bicub") or nearest neighbour ("n" or "c"). Additionally, there are two methods for upscaling: "mean" and "median" (the latter is not yet implemented). |
mask , newmask |
A mask (grid of same dimension as infield), points with value 0 (or FALSE) are not used for interpolation. You must provide it for both the old and new grid. |
weights |
Output from |
This routine uses interpolation to transform the data to a new domain (for instance, different grid resolution, different projection...).
If you use Land/Sea masks, it is possible that a "land" point in the new domain lies between 4 "sea" points of the original domain. In that case, the mask is not applied (the interpolation uses force=FALSE
).
A geofield
object.
zoomgrid
, subgrid
,
Make.domain
, point.interp
,
upscale
## Not run:
regrid(field1,field2) # this will output the data of field1 interpolated to the grid of field 2
iview(field1)
cview(regrid(field2),add=TRUE) # add contours of field2, interpolated to the last plotted grid, which is field1.
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.