Compute Power Spectra With Optional Subject-Level Aggregation
Source:R/plotting.R
get_power_spectra.RdComputes power spectral density estimates using spectrum,
optionally aggregated across subjects or posterior predictive samples.
All arguments intended for the underlying spectral estimator should be
supplied through spectrum.args.
Usage
get_power_spectra(data, by.postn = FALSE, spectrum.args = list())Arguments
- data
A data frame with reaction time data. Must contain
subjectsandrt, and for posterior predictive data optionallypostnandtrials.- by.postn
Logical. If
TRUE, compute a separate spectrum for each posterior predictive draw and each posterior sample index.- spectrum.args
A named list of arguments passed directly to
spectrum. These override the defaults internally used in this function. Useful for customizing smoothing spans, detrending, tapering, and so on. Defaults:list(spans=c(3, 5), detrend=FALSE, demean=TRUE, log=FALSE, taper=0). By default, we runspectrumwithoutlog, and log-transform while plotting