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)))
}

Try the Hmisc package in your browser

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

Hmisc documentation built on Sept. 12, 2023, 5:06 p.m.