View source: R/createComparableCDL.R
createComparableCDL | R Documentation |
createComparableCDL
uses a base index within a raster list, and sets all other
raster images within the list to the same resolution, projection, and extent. The
raster function resample is used to transform raster images, therefore this
function may be quite slow without tuning.
createComparableCDL(
rasterList,
filenames,
baseIndex = 1,
progress = "",
threads = FALSE
)
rasterList |
A list of raster images. |
filenames |
An array of file names of raster images to coerce into a raster list,
if |
baseIndex |
The index of the raster list element that all other elements will match with respect to resolution, projection and extent (default = 1). |
progress |
A string for the raster progress bar type, default "" is none, "text" provides text output, "window" provides a gui window if available. Not available for terra. |
threads |
(terra only) passes the thread parameter to Terra (default = FALSE). |
A list of raster images matching in extent, resolution, and projection.
Jonathan Lisic, jlisic@gmail.com
## Not run:
# download multiple years of Iowa Data
# for raster
r <- getCDL('iowa',c(2006,2010))
# resample based on the 2006
r2 <- createComparableCDL(r,baseIndex=1)
# for terra (note it will just reload what was already downloaded)
r_terra <- getCDL('iowa',c(2006,2010), returnType = 'terra')
# resample based on the 2006
r_terra2 <- createComparableCDL(r_terra,baseIndex=1)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.