Stack Exchange
Stack Overflow
Questions
Tags
Users
About
Stack Overflow
Public
Questions
Tags
Users
About
How to merge all the elements of a vector into only one elements in R?
Asked
Mar 22 '21 at 09:44
Active
Mar 22 '21 at 09:46
Viewed
21 times
0
Myvector
A = c("a", "b", "c")
I would like to have this
B= "a|b|c"
r
string
edited Mar 22 '21 at 09:46
Ronak Shah
377,200
20
156
213
asked Mar 22 '21 at 09:44
VIX
5
3
1
`B <- paste0(A, collapse = '|')`
–
Ronak Shah
Mar 22 '21 at 09:46
Fantastic! It works. Thank you
–
VIX
Mar 22 '21 at 09:55
0 Answers
0