Skip to contents

Displays the peak cross-correlation over time from the result of slidingCrossCorrelation.

Usage

plotCouplingTimecourse(result, title = "Coupling Time Course", ...)

Arguments

result

A list returned by slidingCrossCorrelation, containing at least $times and $peak_correlations.

title

Character string for the plot title (default "Coupling Time Course").

...

Additional arguments (currently unused).

Value

A ggplot object.

References

Wickham, H. (2016). ggplot2: Elegant Graphics for Data Analysis. Springer-Verlag New York. doi:10.1007/978-3-319-24277-4

Examples

sr <- 500
set.seed(1)
x <- rnorm(5000)
y <- c(rep(0, 10), x[1:4990])
res <- slidingCrossCorrelation(x, y, sr = sr,
                                window_sec = 1, step_sec = 0.5)
if (requireNamespace("ggplot2", quietly = TRUE)) {
  plotCouplingTimecourse(res)
}