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
get_interaction_error(x, y, trace, error_type = c("sd", "se"))
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.
The vector whose levels will form the x axis
The vector whose levels will form the y axis, the response vector i.e.
Another vector whose levels will form the traces
Either "sd" for standard deviation, or "se" for standard error.