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

Try the pillar package in your browser

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

pillar documentation built on March 31, 2023, 10:19 p.m.