plot_mosaic.tna_data: Plot State Frequencies as a Mosaic Between Two Groups

plot_mosaic.tna_dataR Documentation

Plot State Frequencies as a Mosaic Between Two Groups

Description

Plot State Frequencies as a Mosaic Between Two Groups

Usage

## S3 method for class 'tna_data'
plot_mosaic(x, group, label = "Group", digits = 1, ...)

Arguments

x

A tna_data object.

group

A character string giving the column name of the (meta) data to contrast the frequencies with or a vector of group indicators with the the same length as the number of rows in the sequence data.

label

An optional character string that specifies a label for the grouping variable when group is not a column name of the data.

digits

An integer that determines the number of digits to use for the chi-square test statistic and the p-value in the plot.

...

Ignored.

Value

A ggplot object.

See Also

Basic functions build_model(), hist.group_tna(), hist.tna(), import_data(), plot.group_tna(), plot.tna(), plot_frequencies(), plot_frequencies.group_tna(), plot_mosaic(), plot_mosaic.group_tna(), prepare_data(), print.group_tna(), print.summary.group_tna(), print.summary.tna(), print.tna(), print.tna_data(), simulate.tna(), summary.group_tna(), summary.tna(), tna-package

Examples

d <- data.frame(
  time = rep(1:5, rep = 4),
  group = rep(1:4, each = 5),
  event = sample(LETTERS[1:3], 20, replace = TRUE)
)
sequence_data <- prepare_data(
  d,
  time = "time",
  actor = "group",
  action = "event"
)
plot_mosaic(sequence_data, group = "group")


tna documentation built on June 8, 2025, 10:33 a.m.