Wrappers around base::paste with a variety of defaults:

mnemoniccollapse=sep=
p(), p0()paste, paste0NULL""
ps(), pss()paste (sep) spaceNULL" "
psh()paste sep hyphenNULL"-"
psu()paste sep underscoreNULL"_"
psnl()paste sep newlineNULL"\n"
pc()paste collapse""""
pcs()paste collapse space" """
pcc()paste collapse comma", """
pcsc()paste collapse semicolon"; """
pcnl()paste collapse newline"\n"""
pc_and()paste collapse andvaries""
pc_or()paste collapse orvaries""
mnemoniccollapse=
p(..., sep = "")

ps(...)

pss(...)

psu(...)

psh(...)

psnl(...)

p0(...)

pc(..., sep = "")

pcs(..., sep = "")

pcc(..., sep = "")

pcnl(..., sep = "")

pcsc(..., sep = "")

pc_and(..., sep = "")

pc_or(..., sep = "")

Arguments

..., sep

passed on to base::paste

See also

Examples

x <- head(letters, 3) y <- tail(letters, 3) # paste p(x, y)
#> [1] "ax" "by" "cz"
p0(x, y)
#> [1] "ax" "by" "cz"
# paste + collapse pc(x)
#> [1] "abc"
pc(x, y)
#> [1] "axbycz"
pcs(x)
#> [1] "a b c"
pcc(x)
#> [1] "a, b, c"
pcc(x, y)
#> [1] "ax, by, cz"
pcsc(x)
#> [1] "a; b; c"
pcnl(x)
#> [1] "a\nb\nc"
pc_and(x[1:2])
#> [1] "a and b"
pc_and(x[1:3])
#> [1] "a, b, and c"
pc_or(x[1:2])
#> [1] "a or b"
pc_or(x[1:3])
#> [1] "a, b, or c"
pc_and(x, y)
#> [1] "ax, by, and cz"
pc_and(x, y, sep = "-")
#> [1] "a-x, b-y, and c-z"
pc_and(x[1])
#> [1] "a"
pc_and(x[0])
#> [1] ""