Hi,

I am working in R environment and I have a long list of gene names which I am showing few first objects of it here:

```
[1] SPNCRNA.1436,omh5,snR95
[2] snR46
[3] snR10
[4] SPNCRNA.1651,SPNCRNA.515
[5] snR42
[6] SPNCRNA.1094,SPNCRNA.1095,SPRRNA.47,SPRRNA.48
[7] snR88
[8] SPNCRNA.497
[9] SPSNORNA.54
[10] snoR39b
```

I am wondering if there is any way to split the indexes with several gene names in them into individual ones? The list is so long.

Thanks!
You can `sapply` with `strsplit` to split each element of the vector by `,`

Edit: Sorry, I was half asleep when I wrote this answer, so could not test code before posting it here. I've now added the logic behind my solution, code and output.

Logic:

Apply `strsplit` on each element of the vector and flatten the resulting list of vectors using `unlist`.

Code:

```
> x <- c("SPNCRNA.1436,omh5,snR95","snR46", "snR10", "SPNCRNA.1651,SPNCRNA.515","SPNCRNA.1094,SPNCRNA.1095,SPRRNA.47,SPRRNA.48")
> listOfSplitStringVectors<-sapply(x,function(i) strsplit(i,",")
> flattenedVectorOfNames=unlist(listOfSplitStringVectors,recursive = TRUE,use.names = FALSE)
```

Output:

```
[1] "SPNCRNA.1436" "omh5"         "snR95"        "snR46"        "snR10"       
[6] "SPNCRNA.1651" "SPNCRNA.515"  "SPNCRNA.1094" "SPNCRNA.1095" "SPRRNA.47"   
[11] "SPRRNA.48"
```