mastMap: Map data and predictions for mastif model

View source: R/mastifFunctions.R

mastMapR Documentation

Map data and predictions for mastif model

Description

Maps dispersal data (trees and seed traps) with predictions.

Usage

  mastMap(mapList)

Arguments

mapList

list that includes data.frames described in the mastif help page: treeData, seedData, xytree, xytrap. Alternatively, mapList can be an object of class mastif simulated by mastSim or fitted by mast. If a class mastif object is used, it must have appended mapPlot (name of plot to map) and mapYears (years to map). These and additional objects in mapList are summarized here:

mapPlot: character for the plot name, which appears in treeData$plot and seedData$plot.

mapYears: numeric vector containing years to plot, which appear in treeData$year and seedData$year.

treeSymbol: character indicating a column name in treeData holding numeric values that scale the sizes of trees in the map, e.g., diam for diameter.

PREDICT: if TRUE, then predicted seed will be mapped. Must be predicted in mastif.

xlim: vector with upper and lower plot limits.

ylim: vector with upper and lower plot limits.

MAPTRAPS: include seed traps in map.

MAPTREES: include trees in map.

seedMax: numeric value can be used to set maximum seed symbol/prediction contour.

fecMax: numeric value can be used to set maximum fecundity symbol size.

mfrow: numeric vector of length-2 to set arrangement of maps on plot, as in pars().

LEGEND: add legend with species names to map.

plotScale: some level of control on size of plot is possible with values > 1.

treeScale: relative scale for tree symbols, default value = 1.

trapScale: relative scale for trap symbols, default value = 1.

SCALEBAR: add a scale bar with distance to bottom of map.

scaleValue: numeric value in meters used if SCALEBAR = TRUE.

mfrow: numeric vector of length-2, giving numbers of rows and columns for plots, see help(pars).

COLORSCALE: if TRUE, then a color scale is added for predicted seed.

Details

Generates of map of seed traps and trees, with symbols scaled to the sizes relative to seed counts in sdata$seedNames and treeSymbol. Sizes are adjusted with scaleTree and scaleTrap.

If PREDICT = TRUE, then predictions come in the object fitted in mastif with predictList used to specify prediction plots and years. See the help page for mastif.

More detailed vignettes can be obtained with:

browseVignettes('mastif')

Value

Only graphical outputs.

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 is can be obtained with:

browseVignettes('mastif')

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

Examples


# simulate data (see \link{\code{mastSim}})
seedNames  <- specNames  <- 'acerRubr'
sim    <- list(nyr=10, ntree=30, nplot=5,
          specNames = specNames, seedNames = seedNames)
inputs <- mastSim(sim)

inputs$mapPlot <- 'p1'
inputs$mapYears = inputs$years[1]

mastMap( inputs )

# for Pinus
d <- "https://github.com/jimclarkatduke/mast/blob/master/pinusExample.rdata?raw=True"
repmis::source_data(d)

specNames <- c("pinuEchi","pinuRigi","pinuStro","pinuTaed","pinuVirg")
seedNames <- c(specNames, "pinuUNKN")

mapList <- list( treeData = treeData, seedData = seedData, 
                 specNames = specNames, seedNames = seedNames, 
                 xytree = xytree, xytrap = xytrap, mapPlot = 'DUKE_BW', 
                 mapYears = c(2004:2007), treeScale = .5, trapScale=1.2, 
                 plotScale = 1.2, LEGEND=TRUE)
mastMap(mapList) 


mastif documentation built on Feb. 16, 2023, 5:30 p.m.