Learn R Programming

diegr (version 0.2.0)

boxplot_epoch: Plot interactive boxplots of EEG amplitude on epoch level

Description

Function for plotting interactive boxplots of EEG amplitude in individual epochs within the chosen time interval. The function assumes data from a single subject and a single sensor. 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_epoch(
  data,
  amplitude = "signal",
  epoch = NULL,
  time_lim,
  title_label = NULL,
  use_latex = TRUE
)

Value

A plotly object with boxplots of EEG amplitude for individual epochs.

Arguments

data

A data frame or a database table with EEG dataset. Required columns: epoch, time and the column with EEG amplitude named as in amplitude parameter.

amplitude

A character specifying the name of the column from input data with an EEG amplitude values. Default is "signal".

epoch

A vector with numbers of epochs to plot. If missing, boxplots are drawn for all avaliable epochs in data.

time_lim

A numeric vector with time range to plot.

title_label

A character string specifying the title of the plot. Defaults to NULL for plot without title.

use_latex

A logical value indicating whether to use LaTeX formatting for the y-axis title. The default is TRUE.

Details

The input data frame or database table must contain at least following columns: epoch - a column with epoch numbers, time - a column with time point numbers, and a column with measured EEG signal values (or their averages) called as in amplitude.

See Also

boxplot_subject

Examples

Run this code
# Interactive boxplots of signal from channel E34 for subject 1 (health control)
# in time points 10:20
epochdata |>
pick_data(subject_rg = 1, sensor_rg = "E34") |>
boxplot_epoch(amplitude = "signal", time_lim = c(10:20),
title_label = "Subject 1, channel E34")

Run the code above in your browser using DataLab