R/nstr.s

Defines functions nstr

Documented in nstr

nstr <- function(string, times) {
  if(!is.atomic(string))
    stop("argument string must be an atomic vector")

  if(!is.numeric(times))
    stop("len must be a numeric vector")

  if(length(string) == 0)
    return(NULL)

  if(length(times) == 0)
    return(character(0))

  return(.Call("do_nstr", as.character(string), as.integer(times)))
}
harrelfe/Hmisc documentation built on March 19, 2024, 3:22 a.m.