aggregateYears | R Documentation |
Aggregated all available years in a Field or a data.table object (with years denoted by column "Years").
aggregateYears(x, method = "mean", verbose = FALSE)
x |
A Field or data.table (with a "Year" column) |
method |
A character string describing the method by which to aggregate the data. Can currently be "mean", "mode", "median", "sum", "max", "min", "sd", "var" and "cv" (= coefficient of variation: sd/mean). For technical reasons these need to be implemented in the package in the code however it should be easy to implement more, please just contact the author! |
verbose |
If TRUE give some progress update about the averaging. |
A Field or data.table depending on the input object
Matthew Forrest matthew.forrest@senckenberg.de
# Get an example Field
test.dir <- system.file("extdata", "LPJ-GUESS_Runs", "CentralEurope", package = "DGVMTools")
test.Source <- defineSource(name = "LPJ-GUESS", dir = test.dir, format = GUESS)
field <- getField(source = test.Source, quant = "lai")
# calculate of mean of all years
mean.allyears <- aggregateYears(x = field, method = "mean", verbose = TRUE)
print(mean.allyears@data)
print(plotSpatial(mean.allyears))
# calculate standard deviation of all years
sd.allyears <- aggregateYears(x = field, method = "sd", verbose = FALSE)
print(sd.allyears@data)
print(plotSpatial(sd.allyears))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.