Learn R Programming

erp.easy (version 1.0.0)

butterfly: Generate a butterfly plot for a specified condition

Description

butterfly plots all individual waveforms for the condition specified by the stim argument (i.e., a butterfly plot). The grand average waveform is also plotted, using a red line.

Usage

butterfly(data, electrodes, stim = 1)

Arguments

data
A data frame in the format returned from load.data
electrodes
A single value or concatenation of several values (to be averaged) indicating which electrodes to include in generating the plot. At this time, if the raw data files imported using load.data) do not have a header, you must include a capital "V" in front of the number and enclose each electrode in quotes. (For example, electrodes = "V78", or electrodes = c("V78", "V76").)
stim
An integer specifying which condition to plot. Conditions are numbered in the order in which they are imported with load.data. The plot title will specify the name of the condition to avoid confusion.

Value

A single butterfly plot for the condition specified with stim.

Details

Single electrodes can be passed to the package functions, or several electrodes can be provided (i.e., when using dense arrays) and those electrodes will be averaged together as a single electrode.

Examples

Run this code
butterfly(ERPdata, electrodes = "V78", stim = 1)

Run the code above in your browser using DataLab