R/whichFirstIndex_isNonZero.R

Defines functions whichFirstIndex_isNonZero

Documented in whichFirstIndex_isNonZero

#' What first index is not a 0 in cumulative numeric vector?
#'
#' @param inVec Numeric cumulative vector.
#' @return Index of first element that is not a 0.
#' @export


whichFirstIndex_isNonZero = function(inVec){
  inVec[inVec!=0] = 1
  o = match(1,inVec)
  o
}
msxakk89/dat documentation built on Aug. 3, 2020, 6:39 p.m.