The concat()
function is at default identical to paste(c(...), sep = "", collapse = "")
.
The collapse()
function is at default identical to paste(x, sep = "", collapse = "")
.
concat(..., sep = "")
collapse(x, sep = "")
Arguments
- ..., x
element(s) to be pasted together, can also be vectors
- sep
separator character, will also be used for collapsing
Examples
concat("a", "b", "c")
#> [1] "abc"
concat(c("a", "b"), "c")
#> [1] "abc"
collapse(c("a", "b"), "c")
#> [1] "acb"
concat(letters[1:5], "-")
#> [1] "abcde-"
collapse(letters[1:5], "-")
#> [1] "a-b-c-d-e"