R/pad.R

Defines functions pad

pad <-
function(x, len, location = c("end", "start", "sym")){
  location = match.arg(location)
  if(length(x) > len){
    stop("Cannot do negative padding.")
  }
  if (location == "end"){
    return(c(x, numeric(len - length(x))))
  }
  if (location == "start"){
    return(c(numeric(len - length(x)), x))
  }
}
bhklab/fastCI documentation built on Dec. 3, 2020, 12:17 a.m.