Learn R Programming

diegr (version 0.2.0)

boxplot_rt: Plot interactive boxplots of response times

Description

Function for plotting interactive boxplots of response time in individual epochs for selected subjects. If the condition column is present in the input data, the boxplots are color-coded by condition. The interactive plotly output enables to easily determine the epoch number from which outliers come and also allows to easily edit the image layout.

Usage

boxplot_rt(data, subject = NULL)

Value

A plotly object with boxplots of response times.

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.

Examples

Run this code
# Display interactive boxplots for both example subjects
boxplot_rt(rtdata)

# 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)

Run the code above in your browser using DataLab