summary.spwb {medfate} | R Documentation |
Summarize simulation results
Description
Function summary
summarizes the model's output in different temporal steps (i.e. weekly, annual, ...).
Usage
## S3 method for class 'spwb'
summary(
object,
freq = "years",
output = "WaterBalance",
FUN = sum,
bySpecies = FALSE,
months = NULL,
...
)
## S3 method for class 'pwb'
summary(
object,
freq = "years",
output = "WaterBalance",
FUN = sum,
bySpecies = FALSE,
months = NULL,
...
)
## S3 method for class 'growth'
summary(
object,
freq = "years",
output = "WaterBalance",
FUN = sum,
bySpecies = FALSE,
months = NULL,
...
)
## S3 method for class 'fordyn'
summary(
object,
freq = "years",
output = "WaterBalance",
FUN = sum,
bySpecies = FALSE,
months = NULL,
...
)
Arguments
object |
An object of class |
freq |
Frequency of summary statistics (see |
output |
The data table to be summarized. Accepted values are the path to data tables in |
FUN |
The function to summarize results (e.g., |
bySpecies |
Allows aggregating output by species before calculating summaries (only has an effect with some values of |
months |
A vector of month numbers (1 to 12) to subset the season where summaries apply. |
... |
Additional parameters for function |
Value
A matrix with dates as row names and the desired summaries in columns
Note
When applied to fordyn
objects, the summary function can be used to gather the results of different yearly steps into a single table while keeping a daily resolution (i.e. using freq = "days"
.
Author(s)
Miquel De Cáceres Ainsa, CREAF
See Also
spwb
, pwb
, growth
, fordyn
,
plot.spwb
, extract
Examples
#Load example daily meteorological data
data(examplemeteo)
#Load example plot plant data
data(exampleforest)
#Default species parameterization
data(SpParamsMED)
#Define soil with default soil params (4 layers)
examplesoil <- defaultSoilParams(4)
#Initialize control parameters
control <- defaultControl("Granier")
#Initialize input
x <- spwbInput(exampleforest,examplesoil, SpParamsMED, control)
#Call simulation function
S1<-spwb(x, examplemeteo, latitude = 41.82592, elevation = 100)
#Queries the tables in 'Soil'
names(S1$Soil)
#Monthly summary (averages) of soil relative water content
summary(S1, freq="months",FUN=mean, output="RWC")
#Queries the tables in 'Plants'
names(S1$Plants)
#Monthly summary (averages) of plant stress
summary(S1, freq="months",FUN=mean, output="PlantStress",
bySpecies = TRUE)