resample | R Documentation |
resample transfers values between SpatRaster objects that do not align (have a different origin and/or resolution). See project
to change the coordinate reference system (crs).
If the origin and extent of the input and output are the same, you should consider using these other functions instead: aggregate
, disagg
, extend
or crop
.
## S4 method for signature 'SpatRaster,SpatRaster'
resample(x, y, method, threads=FALSE, filename="", ...)
x |
SpatRaster to be resampled |
y |
SpatRaster with the geometry that |
method |
character. Method used for estimating the new cell values. One of:
|
threads |
logical. If |
filename |
character. Output filename |
... |
additional arguments for writing files as in |
SpatRaster
aggregate
, disagg
, crop
, project
r <- rast(nrows=3, ncols=3, xmin=0, xmax=10, ymin=0, ymax=10)
values(r) <- 1:ncell(r)
s <- rast(nrows=25, ncols=30, xmin=1, xmax=11, ymin=-1, ymax=11)
x <- resample(r, s, method="bilinear")
opar <- par(no.readonly =TRUE)
par(mfrow=c(1,2))
plot(r)
plot(x)
par(opar)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.