Last chance! 50% off unlimited learning
Sale ends in
Merges all the values and outputs a string formatted as '1st element', '2nd element', ...
vector2string(
x,
quotation_mark = "'",
collapse = sprintf("%s, %s", quotation_mark, quotation_mark)
)
A string with ', '
separation
The vector to collapse
The type of quote to use
The string that separates each element
vector2string(1:4)
vector2string(c("a", "b'b", "c"))
vector2string(c("a", "b'b", "c"), quotation_mark = '"')
Run the code above in your browser using DataLab