get_interaction_error: Get error bars for interaction plot

Description Usage Arguments Value

View source: R/get_interaction_error.R

Description

This function gets error bars for an interaction plot it takes in the x, y, and trace factor of the interaction plot and returns a vector indicating how much should default error type is standard error

Usage

1
get_interaction_error(x, y, trace, error_type = c("sd", "se"))

Arguments

x

The vector whose levels will form the x axis

y

The vector whose levels will form the y axis, the response vector i.e.

trace

Another vector whose levels will form the traces

error_type

Either "sd" for standard deviation, or "se" for standard error.

Value

returns a list with two elements. The first element called "means" contains the mean y values for the combinations of the x and trace variables. The second element, called "se" or "sd" depending on error_type contains the errors for the same combinations.


cape documentation built on Feb. 10, 2021, 5:06 p.m.