Dear Erin,
I think that projectRaster(from = import_raster, to = r) or crop(x =
import_raster, y = r) is what you need. crop() simply crop x with the
extent of y, while projectRaster(from, to) create a raster from from
that has exactly the same structure (resolution, origin, nrow, ncol,
crs) as to.
HTH,
?kos
--------
?kos Bede-Fazekas
Centre for Ecological Research, Hungary
2022.08.02. 17:37 keltez?ssel, Erin Hodgess ?rta:
Hello!
I have a raster with the following bbox:
min max
s1 -180.00417 180.00417
s2 -65.00417 75.00417
I would like to create a subset of that raster layer with the following
dimensions:
class : RasterLayer
dimensions : 180, 360, 64800 (nrow, ncol, ncell)
resolution : 0.02222147, 0.003172611 (x, y)
extent : -90.4184, -82.41867, 41.69613, 42.2672 (xmin, xmax, ymin,
ymax)
crs : +proj=longlat +datum=WGS84 +no_defs
Is there an easy way to do this, please?
I did a "which" subset, but it produced an incredibly long vector.
Any suggestions much appreciated.
Sincerely,
Erin
Erin Hodgess, PhD
mailto: erinm.hodgess at gmail.com
[[alternative HTML version deleted]]