Convert sample indices to times
References
Delorme A, Makeig S (2004). "EEGLAB: an open source toolbox for analysis of single-trial EEG dynamics." Journal of Neuroscience Methods, 134(1), 9-21.
See also
timeToSamples for the inverse conversion,
samplingRate for the sampling rate,
timeIndex for the full time vector
Examples
pe <- PhysioExperiment(
assays = list(raw = matrix(rnorm(1000), nrow = 100)),
samplingRate = 100
)
samplesToTime(pe, c(1L, 51L, 101L))
#> [1] 0.0 0.5 1.0