plot_model: Plot Demographic Model This function creates a graphical...

View source: R/plot_model.R

plot_modelR Documentation

Plot Demographic Model This function creates a graphical representation of a demographic model defined by a template (.tpl) and estimation (.est) file. Concern: Setting initial growthrate values to a variable name will probably lead to failure. fastsimcoal features not implemented: 'nomig' historical event directive.

Description

Plot Demographic Model

This function creates a graphical representation of a demographic model defined by a template (.tpl) and estimation (.est) file. Concern: Setting initial growthrate values to a variable name will probably lead to failure. fastsimcoal features not implemented: 'nomig' historical event directive.

Usage

plot_model(
  tpl.path,
  est.path,
  model.title = "",
  popnames = NULL,
  show.priors = TRUE,
  pops.spacer = 1.1,
  plotmargin = c(1.1, 1.01, 1.05, 1),
  label.cex = 0.75,
  warn.about.comments = FALSE,
  priors.panel.width = 0.3,
  use.mean = TRUE
)

Arguments

tpl.path

Path to tpl file of model

est.path

Path to est file of model

model.title

Character string with the title text to use above the plot, e.g., the model name/ID. Default is "".

popnames

Optional character vector with label names to use for populations. Default is NULL (don't print names on plot); supplying a single integer 1 will use names of the form "pop0", "pop1",... If a character vector is supplied, the number of names supplied should equal the number of populations indicated on line two of template file. Ordering of names correspond to population 0, population 1, ..., as used in the template and estimation files.

show.priors

Whether or not to also plot the prior probability distributions of parameters. Default is FALSE. This is still in progress.

pops.spacer

Number from 1 to 2 indicating amount of white space to allow between populations. Default is 1.05.

plotmargin

Numerical vector indicating how much extra plotting area to add below, left, above, and rigt of the graph.

label.cex

Size to use for text labels (not including axis labels)

warn.about.comments

Whether or not to warn about in-line comments found in unusual places of '.tpl' file. Default is FALSE.

priors.panel.width

Fraction of the plot to use for plotting the priors panel. Default is 0.3. Ignored if show.priors is FALSE. Setting this argument to zero is the same as setting show.priors FALSE.

use.mean

Whether or not to use the mean or a random sample from each paramater's prior distribution when drawing graphs. Default is TRUE.

Value

An object of class 'recordedplot' that stores a copy of the plot. See examples.


JeffWeinell/misc.wrappers documentation built on Sept. 20, 2023, 12:42 p.m.