nearestTimeIndex: GET INDEX FOR NEAREST TIME

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/RTCAfunctions.R

Description

Get index for the nearest time point to the given one. Called internally in many time-point related functions.

Usage

1

Arguments

rtca

An object of RTCA

time

numeric, a time point

Details

The function finds the time point with minimum absolute difference to the given time and returns its index.

Value

An integer, the index of the nearest time point

Author(s)

Jitao David Zhang jitao_david.zhang@roche.com

See Also

timepoints to return all time points of an RTCA object.

Examples

1
2
3
4
5
6
7
8
require(RTCA)
  
ofile <- system.file("/extdata/testOutput.csv", package="RTCA")
x <- parseRTCA(ofile)

x
xIndex <- nearestTimeIndex(x, 25)
timepoints(x)[xIndex]

RTCA documentation built on Nov. 8, 2020, 7:52 p.m.