Wrappers around base::paste
with a variety of defaults:
| mnemonic | collapse= | sep= |
p() , p0() | paste, paste0 | NULL | "" |
ps() , pss() | paste (sep) space | NULL | " " |
psh() | paste sep hyphen | NULL | "-" |
psu() | paste sep underscore | NULL | "_" |
psnl() | paste sep newline | NULL | "\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 and | varies | "" |
pc_or() | paste collapse or | varies | "" |
| mnemonic | collapse= |
p(..., sep = "") ps(...) pss(...) psu(...) psh(...) psnl(...) p0(...) pc(..., sep = "") pcs(..., sep = "") pcc(..., sep = "") pcnl(..., sep = "") pcsc(..., sep = "") pc_and(..., sep = "") pc_or(..., sep = "")
..., sep | passed on to |
---|
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] ""