barplot.sevt: Bar plots of stage probabilities

View source: R/2-plot-functions.R

barplot.sevtR Documentation

Bar plots of stage probabilities

Description

Create a bar plot visualizing probabilities associated to the different stages of a variable in a staged event tree.

Usage

## S3 method for class 'sevt'
barplot(
  height,
  var,
  ignore = height$name_unobserved,
  beside = TRUE,
  horiz = FALSE,
  legend.text = FALSE,
  col = NULL,
  xlab = ifelse(horiz, "probability", NA),
  ylab = ifelse(!horiz, "probability", NA),
  ...
)

Arguments

height

an object of class sevt.

var

name of a variable in object.

ignore

vector of stages which will be ignored and left untouched, by default the name of the unobserved stages stored in object$name_unobserved.

beside

a logical value. See barplot.

horiz

a logical value. See barplot.

legend.text

logical.

col

color mapping for the stages, see col argument in plot.sevt.

xlab

a label for the x axis.

ylab

a label for the y axis.

...

additional arguments passed to barplot.

Value

As barplot: A numeric vector (or matrix, when beside = TRUE), giving the coordinates of all the bar midpoints drawn, useful for adding to the graph.

Examples

model <- stages_fbhc(full(PhDArticles, lambda = 1))
barplot(model, "Kids", beside = TRUE)

stagedtrees documentation built on April 29, 2022, 1:06 a.m.