Computes and plots the empirical power spectrum, with optional overlay
of spectra from posterior predictive simulations. All customization of
the spectral estimator is done through spectrum.args, while plot
appearance is controlled via ....
Usage
plot_spectrum(
dat,
pp = NULL,
plot.log = TRUE,
spectrum.args = list(),
trial_duration = NULL,
...
)Arguments
- dat
A data frame containing empirical reaction time data, with at least columns
subjectsandrt.- pp
Optional posterior predictive data in the same format as
dat, includingsubjects,postn, andtrials.- plot.log
Logical. Whether to log-transform frequencies and power before plotting. This does not affect the call to
spectrum: usespectrum.args$list(log = TRUE)to request log spectral density from the estimator itself.- spectrum.args
A named list of arguments forwarded directly to
spectruminsideget_power_spectra.- trial_duration
Optional duration of a trial in seconds. If supplied, the x-axis is labeled in human-readable time units. Otherwise the x-axis is in (log) frequencies of 1/trial.
- ...
Additional graphical parameters passed to
plot.