tadaa_int: Interaction plots

Description Usage Arguments Value See Also Examples

View source: R/tadaa_plots.R

Description

Easily generate interaction plots of two nominal grouping variables and a numeric response variable.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
tadaa_int(
  data,
  response,
  group1,
  group2,
  grid = FALSE,
  brewer_palette = "Set1",
  labels = c("A", "B"),
  show_n = FALSE,
  print = TRUE
)

Arguments

data

A data.frame.

response

Response variable.

group1

First grouping variable.

group2

Second grouping variable.

grid

If TRUE, the resulting graphs will be arranged in a grid via cowplot::plot_grid.

brewer_palette

The name of the RColorBrewer palette to use, defaults to Set1.

labels

Labels used for the plots when printed in a grid (grid = TRUE), defaults to c("A", "B").

show_n

If TRUE, displays N in plot subtitle.

print

Default is TRUE, set FALSE to suppress automatic printing. Useful if you intend to further modify the output plots.

Value

Invisible: A list with two ggplot2 objects named p1 and p2. If print = TRUE: Printed: The one or two ggplot2 objects, depending on grid.

See Also

Other Tadaa-plot functions: tadaa_balance(), tadaa_mean_ci(), tadaa_plot_tukey()

Examples

1
2
3
4
tadaa_int(ngo, stunzahl, jahrgang, geschl)

# As grid, if cowplot is installed
tadaa_int(ngo, stunzahl, jahrgang, geschl, grid = TRUE)

tadaatoolbox documentation built on July 2, 2020, 2:30 a.m.