PlotModels {capm} | R Documentation |
Plot results of capm model functions
Description
Plot results of one of the following functions: SolveIASA
, SolveSI
or SolveTC
.
Usage
PlotModels(model.out = NULL, variable = NULL, col = "red",
col1 = c("cadetblue1", "yellow", "red"), col2 = c("blue",
"darkgreen", "darkred"), x.label = "Years", y.label = NULL,
legend.label = NULL, pop = NULL)
Arguments
model.out |
output of one of the function previously mentioned. |
variable |
string to specify the variable to be ploted. For "n" (population size). "q" (proportion of sterilized animals). For "f1" (owned intact females). "fs1" (owned sterilized females). "m1" (owned intact males). "ms1" (owned sterilized males). "f2" (unowned intact females). "fs2" (unowned sterilized females). "m2" (unowned intact males). "ms2" (unowned sterilized males). "n1" (owned intact animals). "ns1" (owned sterilized animals). "n2" (unowned intact animals). "ns2" (unowned sterilized animals). "N1" (owned animals). "N2" (unowned animals). "N" (total population). For "f" (intact females). "fs" (sterilized females). "m" (intact males). "ms" (sterilized males). "n" (intact animals). "ns" (sterilized animals). "N" (Total population stratified by reproductive status). For "n" (fertile animals). "g" (sterilized animals). "u" (cumulative of sterilized animals) |
col |
string indicating the color of ploted line, when |
col1 |
|
col2 |
|
x.label |
string with the name for x axis. |
y.label |
string with the name for y axis. |
legend.label |
string with the name of the legend, for plots of |
pop |
value indicating the output of |
Details
Font size of saved plots is usually different to the font size seen in graphic browsers. Before changing font sizes, see the final result in saved (or preview) plots.
Other details of the plot can be modifyed using appropriate functions from ggplot2
package.
References
Chang W (2012). R Graphics Cookbook. O'Reilly Media, Inc.
http://oswaldosantos.github.io/capm
See Also
Examples
## IASA model
## Parameters and intial conditions.
data(dogs)
dogs_iasa <- GetDataIASA(dogs,
destination.label = "Pinhais",
total.estimate = 50444)
# Solve for point estimates.
solve_iasa_pt <- SolveIASA(pars = dogs_iasa$pars,
init = dogs_iasa$init,
time = 0:15,
alpha.owned = TRUE,
method = 'rk4')
solve_iasa_rg <- SolveIASA(pars = dogs_iasa$pars,
init = dogs_iasa$init,
time = 0:10,
alpha.owned = TRUE,
s.range = seq(0, .4, l = 15),
a.range = c(0, .2),
alpha.range = c(0, .05),
v.range = c(0, .1),
method = 'rk4')
## Plot unowned population sizes using point estimates
## Not run:
PlotModels(solve_iasa_pt, variable = "ns2")
## Plot all scenarios and change the label for the scenarios.
## Not run
PlotModels(solve_iasa_rg, variable = "ns")
## End(Not run)