R/makeNstr.s

Defines functions makeNstr

Documented in makeNstr

makeNstr <- function(char, len) {
  mapply(function(char, len) {
    if(is.na(len)) {
      '\n'
    } else if(len == 0) {
      ''
    } else {
      paste(rep.int(x=char, times=len), collapse='')
    }
  }, char, len, USE.NAMES=FALSE)
}

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.