Re: [R] split element vector

2021-08-06 Thread Luigi Marongiu
Perfect! thank you On Fri, Aug 6, 2021 at 4:17 PM Bill Dunlap wrote: > > unlist(strsplit(vect, "\n")) > > On Fri, Aug 6, 2021 at 7:13 AM Luigi Marongiu > wrote: >> >> Hello, >> I have a vector that contains some elements with concatenated values, such >> as: >> ``` >> > vect >> [1] "name_1" >>

Re: [R] split element vector

2021-08-06 Thread Bill Dunlap
unlist(strsplit(vect, "\n")) On Fri, Aug 6, 2021 at 7:13 AM Luigi Marongiu wrote: > Hello, > I have a vector that contains some elements with concatenated values, such > as: > ``` > > vect > [1] "name_1" > [2] "name_2" > [3] "name_3\nsurname_3" > [4] "some other text\netc" > ``` > How can I crea

[R] split element vector

2021-08-06 Thread Luigi Marongiu
Hello, I have a vector that contains some elements with concatenated values, such as: ``` > vect [1] "name_1" [2] "name_2" [3] "name_3\nsurname_3" [4] "some other text\netc" ``` How can I create a new vector where each component is an element, such as: ``` > vect [1] "name_1" [2] "name_2" [3] "name