nearestTimeIndex {RTCA} | R Documentation |
Get index for the nearest time point to the given one. Called internally in many time-point related functions.
nearestTimeIndex(rtca, time)
rtca |
An object of |
time |
numeric, a time point |
The function finds the time point with minimum absolute difference to the given time and returns its index.
An integer, the index of the nearest time point
Jitao David Zhang jitao_david.zhang@roche.com
timepoints
to return all time points of an
RTCA
object.
require(RTCA) ofile <- system.file("/extdata/testOutput.csv", package="RTCA") x <- parseRTCA(ofile) x xIndex <- nearestTimeIndex(x, 25) timepoints(x)[xIndex]