R/collapsef.R

Defines functions collapsef

Documented in collapsef

#' Collapse vector to string.
#'
#' A simple wrapper for \code{collapse(sprintf, ...)}.
#'
#' Useful for vectorized call to \code{\link{sprintf}}.
#'
#' @param ... [any]\cr
#'   See \code{\link{sprintf}}.
#' @param sep [\code{character(1)}]\cr
#'   See \code{\link{collapse}}.
#' @return [\code{character(1)}].
#' @export
collapsef = function(..., sep = ",") {
  paste0(sprintf(...), collapse = sep)
}

Try the BBmisc package in your browser

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

BBmisc documentation built on Sept. 29, 2022, 5:12 p.m.