plot_erp | R Documentation |
This function creates a plot file with 9 or 12 electrodes of interests (for now) displaying ERPs for different conditions. It will need a loaded dataframe with your EEG data and a column indicating the condition to display. It assumes that there is a column named Voltage with your voltage values. Default values are provided for electrodes but it can be customized.
plot_erp(
data,
conditionToPlot,
electrodes_list = c("F3", "Fz", "F4", "C3", "Cz", "C4", "P3", "Pz", "P4"),
baseline = c(-2450, -2250),
color_palette = c("#4DAF4A", "#EA2721", "#377EB8", "#FF7F00", "#984EA3", "#000000",
"#5c5c5c", "#945D25", "#FF748C", "#2E692C"),
output_type = "pdf",
adjusted_baseline = FALSE,
time_labels_interval = "auto",
plotname = "auto",
show_check_message = FALSE,
show_conf_interval = FALSE,
custom_labels = list(),
labels_vertical_position = "auto",
labels_height = "auto",
vary = "Voltage",
background = "grid",
line_thickness = 0.75,
line_type = "solid",
polarity_up = "negative"
)
data |
dataframe containing ERP data |
conditionToPlot |
column of the dataframe with different levels to plot |
electrodes_list |
vector of Electrodes names to plot (between quotes) |
baseline |
vector defining the baseline used during preprocessing |
color_palette |
vector with colors for each levels (in the order of levels of conditionToPlot) |
output_type |
file type of the output |
adjusted_baseline |
boolean to indicate if the baseline should be simulated on the time-window provided in |
plotname |
'auto' or custom string for plot title and plot file name |
show_check_message |
boolean to indicate if you want a confirmation message to be displayed before running the function |
show_conf_interval |
boolean to indicate if 95% CI (bootstrapped) should be displayed |
custom_labels |
list of custom label list. Each custom labels should have the structure: list(start_time, end_time, "label") |
labels_vertical_position |
'auto' or custom position for the center of the label (in microVolts) |
labels_height |
'auto' or custom height (in microVolts) |
vary |
variable that is used for the y-axis |
background |
string that defines the color of the background : "grid" (default), "white" and "dark" |
line_thickness |
single value (numeric, e.g. 0.75) or a vector of numerics such as: c(0.75, 1 , 1.25, 1.5) |
line_type |
single value (string, e.g. 'solid') or a vector of strings such as: c('solid', 'dotted , 'dashed','longdash','F1') |
polarity_up |
defines which polarity is plotted up : "negative" or "positive" |
A file containing the ERP plots
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.