This function provides an infix operator for the
paste0 function to concatenate strings. The operator
will concatenate a vector of one or more values. The functionality
is identical to paste0(), but more convenient to use in some
situations.
Value
The concatenated or pasted value. No spaces will be inserted in between the values to paste. If a vector of values is supplied, a vector of pasted values will be returned.
Examples
# Paste together two strings
str <- "Hello" %p% "World"
str
#> [1] "HelloWorld"
# [1] "HelloWorld"
# Paste together number and string
str <- 100 %p% " Kittens"
str
#> [1] "100 Kittens"
# [1] "100 Kittens"
# Paste together two vectors
v1 <- c("A", "B", "C")
v2 <- c(1, 2, 3)
str <- v1 %p% v2
str
#> [1] "A1" "B2" "C3"
# [1] "A1" "B2" "C3"
