| mapIdxToTime {DIAlignR} | R Documentation |
Takes a time vector and index vector of same length. This function create a
new time vector given indices specified in idx. For NA indices
it uses last index to fill time value. For NA appearing at the start
of idx, it uses next index to get time value.
mapIdxToTime(timeVec, idx)
timeVec |
A numeric vector |
idx |
An integer vector |
A mutated time vector
Shubham Gupta, shubh.gupta@mail.utoronto.ca
ORCID: 0000-0003-3500-8152
License: (c) Author (2019) + GPL-3 Date: 2019-12-13
timeVec <- c(1.3,5.6,7.8) idx <- c(NA, NA, 1L, 2L, NA, NA, 3L, NA) mapIdxToTime(timeVec, idx) # c(1.3, 1.3, 1.3, 5.6, 5.6, 5.6, 7.8, 7.8)