plotGrowthModelComp: Plots compared models built with 'growthModelComp' and...

View source: R/IPMpack-Util.r

plotGrowthModelCompR Documentation

Plots compared models built with growthModelComp and survModelComp.

Description

Function plots compared models built with growthModelComp and survModelComp. This can be invoked directly from growthModelComp and survModelComp with the argument makePlot = TRUE.

Usage

plotGrowthModelComp(grObj,summaryTable, dataf, expVars, 
testType = "AIC", 
plotLegend = TRUE, mainTitle = "", legendPos = "topright",...)

plotSurvModelComp(svObj, summaryTable, dataf, expVars, 
testType = "AIC",  plotLegend = TRUE, mainTitle = "",ncuts=20, 
legendPos = "bottomleft",...) 

Arguments

grObj

a list with the objects of the class growth object equal to treatN.

svObj

a list with the objects of the class survival object equal to treatN.

summaryTable

dataframe output from growthModelComp and survModelComp that contains linear predictor and testType scores (see growthModelComp and survModelComp).

dataf

dataframe containing size and sizeNext

expVars

vector, list of covariates. Defaults to c("1", "size", "size + size2").

testType

character string identifying the metric used to compare models. Can be any string that uses loglike from the lm or glm object. For example "AIC" or "BIC". Defaults to "AIC".

plotLegend

logical indicated whether a legend is created. If TRUE, positions the legend in "topleft" for growth models and "bottomleft" for survival models.

mainTitle

string to place as the main attribute in plots (if makePlot = TRUE. defaults to NULL.

ncuts

number of consecutive size values for which to take means of size and survival for plotting.

legendPos

position of the legend on the figure ("topright", "bottomleft", ...)

...

additional arguments to plot (ylim, col, etc)

Details

Plots multiple growth and survival objects returned from growthModelComp and survModelComp. See plotGrowthModelComp and plotSurvModelComp for more details.

Value

a plot object.

Author(s)

C. Jessica E. Metcalf, Sean M. McMahon, Roberto Salguero-Gomez, Eelke Jongejans & Cory Merow.

See Also

growthModelComp,growthModelComp

Examples

# Data with size and sizeNext
dff <- generateData()

grModels <- growthModelComp(dff, makePlot = FALSE)




wpetry/IPMpack2 documentation built on Sept. 29, 2022, 9:41 a.m.