Get the sampling interval of a chromatogram: the median gap between consecutive retention times.
Arguments
- x
A chromatogram, a list of chromatograms, or a
peak_tableobject.- idx
Index of the chromatogram from which to derive the interval, if
xis a list orpeak_table. Defaults to1.- digits
Number of significant digits to round to. Defaults to
6, because a regular time axis carries floating-point noise in the last digits ofdiff.- unit
Unit for the returned interval:
"min","s"or"ms". Defaults toNULL, giving the interval in the units of the chromatogram's own time axis, which is whatpreprocess'sdim1expects. Supply"min"to pair with thetime_resolutionarguments ofplot_chromsandreshape_chroms, which are in minutes, regardless of the units ofx. The units ofxare read from itstime_unitattribute, falling back to minutes when it is absent, asplot_chromsdoes.
Value
A length-one numeric giving the time between consecutive timepoints,
in unit if supplied and otherwise in the units of the chromatogram's time
axis.
See also
Other accessors:
get_baseline(),
get_lambdas(),
get_times()
Examples
data(Sa_warp)
get_time_resolution(Sa_warp)
#> [1] 0.02
