tadaatoolbox (version 0.16.0)

tadaa_int: Interaction plots

Description

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

Usage

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 outpur 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

Run this code
# NOT RUN {
tadaa_int(ngo, stunzahl, jahrgang, geschl)

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

Run the code above in your browser using DataCamp Workspace