Computes the total duration of the signal in seconds from the number of time points and the sampling rate.
Value
Numeric scalar giving the signal duration in seconds, or
NA_real_ if the sampling rate is not set.
References
Huber, W., et al. (2015). "Orchestrating high-throughput genomic analysis with Bioconductor." Nature Methods, 12(2), 115-121. doi:10.1038/nmeth.3252
Morgan, M., et al. (2022). "S4Vectors: Foundation of vector-like and list-like containers in Bioconductor." R package.
See also
samplingRate for the sampling rate,
length,PhysioExperiment-method for time point count,
timeIndex for the time vector,
extractWindow for time-based subsetting
Examples
pe <- PhysioExperiment(
assays = list(raw = matrix(rnorm(1000), nrow = 1000, ncol = 4)),
samplingRate = 100
)
duration(pe) # 10 seconds
#> [1] 10