Description Usage Arguments Details Value Examples
View source: R/reaggregate_by_function.R
This function re-aggregates a multilayered raster dataset according to a function (e.g. maximum, minimum, mean) and a time interval. All raster outputs will be written to GeoTIFF files.
1 2 | reaggregate_by_function(data_layers, fun, dates, basename, output_directory,
bylayer = FALSE, clean = FALSE, mc.cores = 1)
|
data_layers |
A RasterStack or RasterBrick object containing the MODIS data. A RasterBrick object is preferable to reduce processing time. |
fun |
A function that returns a single value and has an |
dates |
A vector of class Date or a number. If |
basename |
A character that will be prepended to all file names to be written. |
output_directory |
A character file path to a directory where all files will be written. |
bylayer |
A logical indicating if the individual raster outputs should
remain separate ( |
clean |
A logical indicating if the individual raster outputs should be
deleted once the multilayered raster has been created. Ignored if
|
mc.cores |
A numeric indicating the number of cores to be used in parallel computing. |
Note that writing to a single multilayered raster means that layer names will not be preserved. That is to say, all layers will simply be named according to the file name with a numerical index appended when the multilayered GeoTIFF is read back into R. The drawback is that any date information contained in the layer name will be lost. Thus, it is advisable to keep the individual raster files so that one can reference back to the date information.
Nothing. This function has a side-effect of writing files to a directory.
1 2 3 4 | ## Not run:
reaggregate_by_function(data_layers, max, "MODIS_max", "C:/Desktop", mc.cores=6)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.