implode {tractor.base} | R Documentation |
Create a character string by concatenating the elements of a vector, using a separator and optional final separator.
implode(strings, sep = "", finalSep = NULL)
strings |
A vector, which will be coerced to mode character . |
sep |
A unit length character vector giving the separator to insert between elements. |
finalSep |
An optional unit length character vector giving the separator to insert between the final two elements. |
A character vector of length one.
Jon Clayden
implode(1:3, ", ") # "1, 2, 3" implode(1:3, ", ", " and ") # "1, 2 and 3" implode(1:2, ", ", " and ") # "1 and 2"