Learn R Programming

medfate (version 0.7.4)

spwbpoints: Model simulations for spatially-distributed forest stands

Description

Functions spwbpoints and growthpoints allow calling local models spwb and growth, respectively, for a set of forest stands distributed in specific locations. No spatial processes are simulated.

Usage

spwbpoints(y, SpParams, meteo, control = defaultControl(),
       dates = NULL, summaryFunction = NULL, args=NULL)
growthpoints(y, SpParams, meteo, control = defaultControl(),
       dates = NULL, summaryFunction = NULL, args=NULL)

Arguments

y

An object of class SpatialPointsLandscape-class.

SpParams

A data frame with species parameters (see SpParamsMED).

meteo

Meteorology data (see details).

control

A list of control parameters (see defaultControl).

dates

A Date object with the days of the period to be modeled. If NULL, then the whole period of meteo is used.

summaryFunction

An appropriate function to calculate summaries (e.g., summary.spwb).

args

List with additional arguments for the summary function.

Value

Functions spwbpoints and growthpoints return a list with the following elements:

  • sp: An object of class SpatialPoints with the spatial coordinates of forest stands.

  • input: A list of objects of class spwbInput or growthInput (one per forest stand). In the case of growthpoints, the input variables will have been modified by the call to the growth function.

  • result: A list the result of calling spwb or growth on each forest stand. If summaryFunction is not null, then each element of the list will contain the result of the summary function.

Details

Functions spwbpoints and growthpoints accept different formats for meteorological input (parameter meteo). If a data.frame is supplied (as in spwb or growth) then the same meteorology is used for all points (not recommended). To specify different meteorology for different points, the user can use an object of SpatialPointsMeteorology-class. Alternatively, the user can supply an object of class SpatialPointsDataFrame-class containing the meta data (columns dir and filename) of meteorological files that will be read from the disk.

See Also

spwb, growth, SpatialPointsLandscape-class

Examples

Run this code
# NOT RUN {
# Load spatial points forest object
data("exampleSPL")

#Load meteorological data (the same will be used for all points)
data("examplemeteo")

#Load species parameters
data("SpParamsMED")

# Deactivate extra console output
control = defaultControl()
control$verbose = FALSE

# Run simulation for the first two forest plots
# (you can run the code without subsetting 'exampleSPL')
res <- spwbpoints(exampleSPL, SpParamsMED, examplemeteo, control = control)

#Extract summaries for a given forest plot
summary(res$result$`80001`, freq="months",FUN=sum, 
        output="PlantStress", bySpecies = TRUE)
# }

Run the code above in your browser using DataLab