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
spwb
,pwb
,growth
orfordyn
.- freq
Frequency of summary statistics (see
cut.Date
).- output
The data table to be summarized. Accepted values are the path to data tables in
object
, such as 'WaterBalance', 'Soil', 'Stand' or 'Plants$LAI'. It is also possible to use strings like 'Transpiration' and the function will interpret it as 'Plants$Transpiration'.- FUN
The function to summarize results (e.g.,
sum
,mean
, ...)- bySpecies
Allows aggregating output by species before calculating summaries (only has an effect with some values of
output
). Aggregation can involve a sum (as for plant lai or transpiration) or a LAI-weighted mean (as for plant stress or plant water potential).- months
A vector of month numbers (1 to 12) to subset the season where summaries apply.
- ...
Additional parameters for function
summary
.
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"
.
Examples
# \donttest{
#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)
#> Initial plant water content (mm): 4.73001
#> Initial soil water content (mm): 290.875
#> Initial snowpack content (mm): 0
#> Performing daily simulations
#>
#> [Year 2001]:............
#>
#> Final plant water content (mm): 4.72838
#> Final soil water content (mm): 274.758
#> Final snowpack content (mm): 0
#> Change in plant water content (mm): -0.00163384
#> Plant water balance result (mm): -0.00163384
#> Change in soil water content (mm): -16.1173
#> Soil water balance result (mm): -16.1173
#> Change in snowpack water content (mm): 0
#> Snowpack water balance result (mm): -7.10543e-15
#> Water balance components:
#> Precipitation (mm) 513 Rain (mm) 462 Snow (mm) 51
#> Interception (mm) 92 Net rainfall (mm) 370
#> Infiltration (mm) 400 Infiltration excess (mm) 21 Saturation excess (mm) 0 Capillarity rise (mm) 0
#> Soil evaporation (mm) 25 Herbaceous transpiration (mm) 14 Woody plant transpiration (mm) 248
#> Plant extraction from soil (mm) 248 Plant water balance (mm) -0 Hydraulic redistribution (mm) 3
#> Runoff (mm) 21 Deep drainage (mm) 130
#Queries the tables in 'Soil'
names(S1$Soil)
#> [1] "SWC" "RWC" "REW" "ML"
#> [5] "Psi" "PlantExt" "HydraulicInput"
#Monthly summary (averages) of soil relative water content
summary(S1, freq="months",FUN=mean, output="RWC")
#> 1 2 3 4 Overall
#> 2001-01-01 0.9937050 0.9994094 0.9997811 1.0244250 1.0007750
#> 2001-02-01 0.9405908 0.9869866 0.9946199 0.9916571 0.9785869
#> 2001-03-01 0.9575419 0.9920896 1.0001473 1.0446446 0.9915653
#> 2001-04-01 0.8689144 0.9567106 0.9798343 0.9704112 0.9435823
#> 2001-05-01 0.8953055 0.9697462 0.9756438 0.9595930 0.9527774
#> 2001-06-01 0.6730439 0.8558696 0.9313034 0.9126062 0.8385741
#> 2001-07-01 0.8997648 0.9174818 0.8953024 0.8749076 0.9031187
#> 2001-08-01 0.9113096 0.9699824 0.9308851 0.9233582 0.9411927
#> 2001-09-01 0.9244234 0.9783524 0.9890764 0.9827638 0.9689650
#> 2001-10-01 0.9530557 0.9864344 0.9863170 0.9956792 0.9795437
#> 2001-11-01 0.9493856 0.9884688 1.0009233 1.0856873 0.9926790
#> 2001-12-01 0.8949966 0.9759742 0.9921108 0.9880233 0.9624524
#Queries the tables in 'Plants'
names(S1$Plants)
#> [1] "LAI" "LAIlive" "FPAR"
#> [4] "AbsorbedSWRFraction" "Transpiration" "GrossPhotosynthesis"
#> [7] "PlantPsi" "LeafPLC" "StemPLC"
#> [10] "PlantWaterBalance" "LeafRWC" "StemRWC"
#> [13] "LFMC" "PlantStress"
#Monthly summary (averages) of plant stress
summary(S1, freq="months",FUN=mean, output="PlantStress",
bySpecies = TRUE)
#> Pinus halepensis Quercus coccifera Quercus ilex
#> 2001-01-01 0.004773864 0.003160448 0.006381390
#> 2001-02-01 0.006788461 0.004090772 0.007680157
#> 2001-03-01 0.006291716 0.003852403 0.007336397
#> 2001-04-01 0.011405208 0.006134456 0.010500066
#> 2001-05-01 0.010107009 0.005523973 0.009602827
#> 2001-06-01 0.056107137 0.022549481 0.029647367
#> 2001-07-01 0.018488315 0.008868019 0.014178829
#> 2001-08-01 0.009072542 0.005163251 0.009226106
#> 2001-09-01 0.008010500 0.004644226 0.008463230
#> 2001-10-01 0.006249494 0.003871769 0.007423667
#> 2001-11-01 0.006677573 0.004028634 0.007589410
#> 2001-12-01 0.009188447 0.005147754 0.009101560
# }