interaction_line_plot: Make a interaction line plot

Description Usage Arguments Value Examples

View source: R/visualization-utils.R

Description

Make a interaction line plot

Usage

1
interaction_line_plot(y, x, by, data, ylim = NULL, xlab = NULL, ylab = NULL)

Arguments

y

A continuous variable to be plotted along the y-axis

x

A continuous variable to be plotted along the x-axis

by

A categorical variable by which we split the data and create one line plot for each resulting group

data

A data frame with the x, y, by variables

ylim

A vector of limits for the y-axis

xlab

The label of the x-axis (defaults to the x variable name).

ylab

The label of the y-axis (defaults to the y variable name).

Value

A ggplot2::ggplot object, which may be modified with further ggplot2 commands.

Examples

1
2
3
4
5
6
7
interaction_line_plot(y = score, x = time, by = treatment, 
                      data = selfesteem2_long, ylim = c(70, 100))
interaction_line_plot(y = score, x = time, by = treatment, 
                      data = selfesteem2_long, 
                      xlab = 'measurement time',
                      ylab = 'self esteem score',
                      ylim = c(70, 100))

psyntur documentation built on Sept. 15, 2021, 5:07 p.m.