Plotting EEG Results with R
The methods here involve using R and the ggplot2 library to create manuscript quality figures. You will need to install both R and R Studio to use the following code. A guide on how to do this is HERE.
You will also have to install the ggplot2 library. To do so, on the command line in R type:
install.packages("ggplot2")
R commands will be in bold. Make sure you set your working directory (SESSION) in R Studio to where your data is stored.
Plotting Two Conditional Waveforms with a Difference Waveform
We will use the sample data HERE for this tutorial. Note that the sample data consists of three columns, the first containing time points, the second and third containing grand average ERP waveform data.
library("ggplot2")
Tells R that you are going to use ggplot2. Ignore the warning.
plot.data = read.table("sample_waves.txt")
Loads the plot data into a table (a data structure).
You will also have to install the ggplot2 library. To do so, on the command line in R type:
install.packages("ggplot2")
R commands will be in bold. Make sure you set your working directory (SESSION) in R Studio to where your data is stored.
Plotting Two Conditional Waveforms with a Difference Waveform
We will use the sample data HERE for this tutorial. Note that the sample data consists of three columns, the first containing time points, the second and third containing grand average ERP waveform data.
library("ggplot2")
Tells R that you are going to use ggplot2. Ignore the warning.
plot.data = read.table("sample_waves.txt")
Loads the plot data into a table (a data structure).