get_interaction_error: Get error bars for interaction plot

View source: R/get_interaction_error.R

get_interaction_errorR Documentation

Get error bars for interaction plot

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

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 May 29, 2024, 5:11 a.m.