R/quantilezaf.R

quantile.zaf <- function (x, probs = seq(0, 1, 0.25),nz){
  N <- length(x) + round(nz)
  x <- sort(x)
  qnt <- 1 + round((probs * (N - 1))) # !
  ql <- c()
  for(j in qnt){
    if(j-nz <=0){
      ql = c(ql,0)
    } else {
      ql = c(ql,x[j-nz])
    }
  }
  names(ql) <- probs
  return(ql)
}

Try the abemus package in your browser

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

abemus documentation built on Dec. 19, 2019, 1:07 a.m.