mastFillCensus {mastif}R Documentation

Interpolate census data for seed trap years

Description

Provides interpolated census data to include years when seed data are available. This is used when tree sampling is at a lower frequency than seed-trap collections.

Usage


  mastFillCensus(inputs, beforeFirst = 15, afterLast = 15, p = 0, verbose = FALSE)
  

Arguments

inputs

list used as input to mastif that must include two character vectors, (specNames, seedNames) and four data.frames (treeData, seedData, xytree, xytrap). See details.

beforeFirst

number of years before a tree is first observed in a census that it should be considered as potentially present.

afterLast

number of years after a tree is last observed in a census that it should be considered as potentially present.

p

if AR(p) model is used (in yearEffect), the number of lag terms.

verbose

if verbose = TRUE information is provided on filling progress.

Details

Masting data sets contain tree census data, held in treeData, and seed trap data, help in seedData. Most studies monitor seed rain frequently (e.g., annual), while tree censuses occur at intervals of 2 to 5 years. mastFillCensus 'fills in' the tree census so that the annual seed data can be used. It is made available to the user so covariates can be added, e.g., with mastClimate.

mastFillCensus accepts the list of inputs used in mastif. The missing years are inserted for each tree with interpolated diameters. inputs is returned with objects updated to include the missing census years and modified slightly for analysis by mastif.

The function mastFillCensus is made accessible to the user, because covariates may be needed for the missing census years. For example, models often include climate variables that change annually. The version of treeData returned by mastFillCensus can be annotated with additional columns that can then be included in the model, as specified in formulaFec, formulaRep, and/or randomEffect$formulaRan.

beforeFirst and afterLast allow the user to control the assumptions about treatment of trees between (and before and after) tree census years. Seed trap data may begin before the first tree census or after the last tree census. Trees may appear in the middle of the study due to ingrowth. They may be lost to mortality. In other words, census data can be left-, right-, and interval-censored.

For the AR(p) model, values are imputed for p years before a tree is first observed and p years after the tree is last observed (mastif). These years are inserted by mastFillCensus, such that they too can then be annotated with covariate data.

More detailed vignettes can be obtained with:

browseVignettes('mastif')

Value

inputs

list includes all inputs to the model, cleaned for mastif, with years inserted to treeData.

Author(s)

James S Clark, jimclark@duke.edu

References

Clark, J.S., C. Nunes, and B. Tomasek. 2019. Foodwebs based on unreliable foundations: spatio-temporal masting merged with consumer movement, storage, and diet. Ecological Monographs, e01381.

See Also

mastSim simulates data

A more detailed vignette can be obtained with:

browseVignettes('mastif')

website 'http://sites.nicholas.duke.edu/clarklab/code/'.

Examples


d <- "https://github.com/jimclarkatduke/mast/blob/master/liriodendronExample.rData?raw=True"
repmis::source_data(d)

inputs   <- list( specNames = specNames, seedNames = seedNames, 
                  treeData = treeData, seedData = seedData, 
                  xytree = xytree, xytrap = xytrap)
inputs <- mastFillCensus(inputs)

formulaFec <- formulaRep <- as.formula(~ diam)
                  
output <- mastif(inputs = inputs, formulaFec, formulaRep, ng = 1000, 
                 burnin = 400)


[Package mastif version 2.3 Index]