plot.spwb {medfate}R Documentation

Plots simulation results

Description

Function plot plots time series of the results of the soil plant water balance model (see spwb), plant water balance model (see pwb), the forest growth model (see growth) or the forest dynamics model (see fordyn).

Usage

## S3 method for class 'spwb'
plot(
  x,
  type = "PET_Precipitation",
  cohorts = NULL,
  bySpecies = FALSE,
  dates = NULL,
  subdaily = FALSE,
  xlim = NULL,
  ylim = NULL,
  xlab = NULL,
  ylab = NULL,
  summary.freq = NULL,
  ...
)

## S3 method for class 'pwb'
plot(
  x,
  type = "PlantTranspiration",
  cohorts = NULL,
  bySpecies = FALSE,
  dates = NULL,
  subdaily = FALSE,
  xlim = NULL,
  ylim = NULL,
  xlab = NULL,
  ylab = NULL,
  summary.freq = NULL,
  ...
)

## S3 method for class 'growth'
plot(
  x,
  type = "PET_Precipitation",
  cohorts = NULL,
  bySpecies = FALSE,
  dates = NULL,
  subdaily = FALSE,
  xlim = NULL,
  ylim = NULL,
  xlab = NULL,
  ylab = NULL,
  summary.freq = NULL,
  ...
)

## S3 method for class 'fordyn'
plot(
  x,
  type = "StandBasalArea",
  cohorts = NULL,
  bySpecies = FALSE,
  dates = NULL,
  xlim = NULL,
  ylim = NULL,
  xlab = NULL,
  ylab = NULL,
  summary.freq = NULL,
  ...
)

Arguments

x

An object of class spwb, pwb, growth or fordyn.

type

The information to be plotted (see details)

cohorts

An integer, boolean or character vector to select the plant cohorts to be plotted. If cohorts = "T" (resp. cohorts = "S") then all tree (resp. shrub) cohorts will be displayed.

bySpecies

Allows aggregating output by species, before drawing plots (only has an effect with some values of type). Aggregation can involve a sum (as for plant lai or transpiration) or a LAI-weighted mean (as for plant stress or plant water potential), where LAI values are those of LAIlive.

dates

A Date vector with a subset of dates to be plotted.

subdaily

Whether subdaily results should be shown, only for simulations using transpirationMode = "Sperry" and having set subdailyResults = TRUE in the simulation control object. If subdaily = TRUE, then the valid strings for type are listed in plot.spwb_day.

xlim

Range of values for x.

ylim

Range of values for y.

xlab

x-axis label.

ylab

y-axis label.

summary.freq

Frequency of summary statistics (see cut.Date).

...

Additional parameters for function plot (not used).

Details

The following plots are currently available for spwb (most of them also for pwb):

The following plots are available for spwb and pwb only if transpirationMode = "Granier":

The following plots are available for spwb and pwb only if transpirationMode = "Sperry":

In addition to the former, the following plots are available for objects growth or fordyn:

Finally, the following plots are only available for fordyn simulation results:

Value

An ggplot object

Author(s)

Miquel De Cáceres Ainsa, CREAF

See Also

spwb, pwb, growth, fordyn, summary.spwb

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)

#Plot results
plot(S1)


[Package medfate version 4.4.0 Index]