powered by
Pastes a series of strings together separated by the `collapse` parameter
sf_collapse(x, collapse)
A single string with all values in `x` pasted together, separated by `collapse`.
A character vector
A single string
This works the same way as `paste0(x, collapse=collapse)`
paste0, paste
x <- c("hello", "\\xe4\\xb8\\x96\\xe7\\x95\\x8c") Encoding(x) <- "UTF-8" sf_collapse(x, " ") # "hello world" in Japanese sf_collapse(letters, "") # returns the alphabet
Run the code above in your browser using DataLab