A wrapper on base::paste().
Usage
p(..., sep = " ", collapse = NULL, recycle0 = FALSE)
p0(..., collapse = NULL, recycle0 = FALSE)Arguments
- ...
one or more R objects, to be converted to character vectors.
- sep
a character string to separate the terms. Not
NA_character_.- collapse
an optional character string to separate the results. Not
NA_character_. Whencollapseis a string, the result is always a string (characterof length 1).- recycle0
logicalindicating if zero-length character arguments should result in the zero-lengthcharacter(0). Note that whencollapseis a string,recycle0does not recycle to zero-length, but to"".
Functions
p0(): A wrapper onbase::paste0()
Examples
p("a", "b")
#> [1] "a b"
p(c("a", "b"), collapse = " ")
#> [1] "a b"
p("a", character(0))
#> [1] "a "
p("a", character(0), recycle0 = TRUE)
#> character(0)
p0("a", "b")
#> [1] "ab"
p0(c("a", "b"), collapse = "")
#> [1] "ab"
p0("a", character(0))
#> [1] "a"
p0("a", character(0), recycle0 = TRUE)
#> character(0)
