R/assert-utils.R

Defines functions collapse_comma

collapse_comma <- function(x, truncate_at = 10) {
  if (length(x) > truncate_at) {
    x <- c(x[seq_len(truncate_at)], "...")
  }

  paste(x, collapse = ", ")
}

Try the woodendesc package in your browser

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

woodendesc documentation built on April 18, 2023, 5:09 p.m.