plot.signal: Plot Signal

View source: R/man.R

plot.signalR Documentation

Plot Signal

Description

Quickfire way to Plot EEG noise, peak, or signal

Usage

plot.signal(data,mark,title)

Arguments

data

Vector to Plot

mark

Optional int, add horixontal line marker

title

Optional string, add title

Author(s)

Rose Connolly connolr3@tcd.ie

Examples

# mysignal<-noise(200,10,250)+7*peak(200,10,250,7,115)
#firstsignal<-mysignal[1:200]
#plot.signal(firstsignal,mark=115,title="Classicaly generated Signal with Peak")

plot.signal <- function(data, mark = NULL, title = "EEG Signal") {
  plot(data, main = title, type = "l")
  # this if statement and corresponding code is applicable for phase resetting theory only
  if (is.null(mark) == FALSE) {
    abline(v = mark, col = "red")
    text(mark + 5, 0.25, paste(mark), srt = 90, col = "red")
  }
}











connolr3/eegdatasim documentation built on April 14, 2022, 10:39 a.m.