Skip to contents

Function for plotting interactive or static boxplots of response time in individual epochs for selected subjects. Both the static ggplot output and the interactive plotly output can be easily customized and edited, while the interactive plotly output additionally allows easy identification of the epoch numbers corresponding to outliers.

If the condition column is present in the input data, the boxplots are color-coded by condition.

Usage

boxplot_rt(data, subject = NULL, interactivity = TRUE)

Arguments

data

A data frame or a database table containing response time data. Required columns: subject, epoch, RT (value of response time in ms). An optional condition column may be used to colour-code the boxplots.

subject

A vector with IDs of subjects to plot. If missing, boxplots are drawn for all available subjects in data.

interactivity

Logical. Determines whether to render an interactive plotly graph (default) or a static ggplot graph.

Value

A plotly or ggplot2 object with boxplots of response times.

Examples

# Display interactive boxplots for both example subjects
boxplot_rt(rtdata)
# Display static boxplots for both example subjects boxplot_rt(rtdata, interactivity = FALSE) # Interactive boxplots per subject divided by condition # a) add condition column to data (just for example) data_cond <- rtdata data_cond$condition <- c(rep("a", 7), rep("b", 7), rep("a", 8), rep("b",7)) # b) plot boxplots (colour-coded by condition) boxplot_rt(data_cond)