Learn R Programming

medfate (version 0.2.2)

plot.swb: Displays soil water balance results

Description

Function plot plots the results of the soil water balance model (see swb), whereas function summary summarizes the model's output in different temporal steps (i.e. weekly, annual, ...).

Usage

# S3 method for swb
plot(x, yearAxis=FALSE, type="PET_Precipitation",
    xlim = NULL, ylim=NULL, xlab=NULL, ylab=NULL,...)
# S3 method for swb
summary(object, freq="years", output="DailyBalance", FUN=sum, ...)

Arguments

x, object

An object of class swb

yearAxis

A boolean to indicate whether the units of the x-axis are years (by default they are days).

type

The information to be plotted:

  • "PET_NetPrec": Potential evapotranspiration and Net Precipitation.

  • "Export": Water exported through deep drainage and surface runoff.

  • "ET": Plant eranspiration and soil evaporation.

  • "Psi": Soil water potential.

  • "Theta": Soil relative water content.

  • "Vol": Soil water volumetric content.

  • "PlantStress": Plant cohort average daily drought stress.

xlim

Range of values for x.

ylim

Range of values for y.

xlab

x-axis label.

ylab

y-axis label.

freq

Frequency of summary statistics (see cut.Date).

output

The data table to be summarized. Accepted values are "DailyBalance", "PlantStress", "PlantTranspiration" and "SoilWaterBalance".

FUN

The function to summarize results (e.g., sum, mean, ...)

...

Additional parameters for functions plot or summary.

References

De C<U+00E1>ceres M, Mart<U+00ED>nez-Vilalta J, Coll L, Llorens P, Casals P, Poyatos R, Pausas JG, Brotons L. (submitted) Coupling a water balance model with forest inventory data to evaluate plant drought stress at the regional level. Agricultural and Forest Meteorology.

See Also

swb, swbpoints

Examples

Run this code
# NOT RUN {
#Load example daily meteorological data
data(examplemeteo)

#Load example plot plant data
data(exampleforest)

#Default species parameterization
data(SpParamsMED)

#Initialize soil with default soil params
examplesoil = soil(defaultSoilParams())

#Prepare input
x = forest2swbInput(exampleforest,SpParamsMED, examplesoil$dVec)

#Call simulation function
S<-swb(x, examplesoil, examplemeteo)
        
#Plot results
plot(S)

#Monthly summary (averages) of soil water balance
summary(S, freq="months",FUN=mean, output="SoilWaterBalance")

# }

Run the code above in your browser using DataLab