| plot_time_mean | R Documentation |
Plot a time curve of the average EEG signal amplitude together with pointwise confidence intervals (CIs).
plot_time_mean(
data,
FS = 250,
t0 = 1,
color = "red",
fill = "lightsalmon",
transp = 0.4,
y_limits = NULL,
label_0ms = "stimulus",
label_offset = c(0, 0)
)
data |
A data frame, tibble or a database table with input data to plot. It should be an output from |
FS |
The sampling frequency. Default value is 250 Hz. |
t0 |
Index of the zero time point, i.e. point, where 0 ms should be marked (most often time of the stimulus or time of the response). |
color |
The color of line. Default value is |
fill |
The color of CI bound, default value is |
transp |
A numeric value between 0 and 1 controlling the transparency of the confidence ribbon (corresponding to |
y_limits |
A numeric vector of length two, specifying the minimum and maximum y-axis limits. Defaults to |
label_0ms |
Character string for the annotation label at the 0ms mark. Default is |
label_offset |
A numeric vector of length two to offset the stimulus label. The first value indicates a horizontal shift, the second a vertical one. Default is |
The output in the form of a ggplot object allows to easily edit the result image properties. For interactive version of plot see interactive_waveforms function.
A ggplot object showing the time course of the average EEG signal with pointwise confidence intervals for chosen sensor.
# Plot average signal with CI bounds for subject 2 from the sensor E65
# excluding outlier epochs 14 and 15
# a) preparing data
# a1) extract required data
edata <- epochdata |>
dplyr::filter(subject == 2 & sensor == "E65" & epoch %in% 1:13)
# a2) baseline correction
data_base <- baseline_correction(edata, baseline_range = 1:10)
# a3) average computing
data_mean <- compute_mean(data_base, amplitude = "signal_base", subject = 2, channel = "E65",
type = "point")
# b) plotting the average line with default settings
plot_time_mean(data = data_mean, t0 = 10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.