vcat function

Paste Utilities -- Concatenate Strings

Paste Utilities -- Concatenate Strings

Concat enate vector elements or anything using paste(*, collapse = .). These are simple short abbreviations I have been using in my own codes in many places.

vcat(vec, sep = " ") ccat(...)

Arguments

  • vec, ...``: any vector and other arguments to be pasted to together.
  • sep: the separator to use, see the Details section.

Details

The functions are really just defined as

vcat := function(vec, sep = " ") paste(vec, collapse = sep)

ccat := function(...) paste(..., collapse = "", sep = "")

Returns

a character string (of length 1) with the concatenated arguments.

Author(s)

Martin Maechler, early 1990's.

See Also

paste, as.character, format. cat() is really for printing.

Examples

ch <- "is" ccat("This ", ch, " it: ", 100, "%") vv <- c(1,pi, 20.4) vcat(vv) vcat(vv, sep = ", ")
  • Maintainer: Martin Maechler
  • License: GPL (>= 2)
  • Last published: 2024-11-05