Learn R Programming

IPMpack (version 2.1)

plotGrowthModelComp: 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)

Value

a plot object.

Details

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

See Also

growthModelComp,growthModelComp

Examples

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

grModels <- growthModelComp(dff, makePlot = FALSE)



Run the code above in your browser using DataLab