[R] split element vector

Luigi Marongiu m@rong|u@|u|g| @end|ng |rom gm@||@com
Fri Aug 6 16:13:18 CEST 2021


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_3"
[4] "surname_3"
[5] "some other text"
[6] "etc"
```
I can split the elements on '\n' but how do I transfer these directly
on a new vector?
Thanks



More information about the R-help mailing list