R/strrep.R

Defines functions strrep_compat

strrep <- NULL
strrep_compat <- function(x, times) {
  map_chr(
    times,
    function(n) {
      if (is.na(n)) {
        NA_character_
      } else {
        paste(rep(x, n), collapse = "")
      }
    }
  )
}
hadley/colformat documentation built on March 9, 2024, 4:58 a.m.