R/getNAsGaps.R

Defines functions getNAsGaps

Documented in getNAsGaps

getNAsGaps <-
function(y) {
  ly <- length(y)
  if (all(is.na(y))) {
    malos <- t(matrix(c(1, ly)))
  } else if (all(is.na(y) == FALSE)) {
    malos <- NULL
  } else {
    malos <- groupIndices(which(is.na(y)))
    malos <- malos[, 1:2]
    colnames(malos) <- NULL
  }
  malos
}

Try the KarsTS package in your browser

Any scripts or data that you put into this service are public.

KarsTS documentation built on Jan. 16, 2021, 5:07 p.m.