Split comma delimited string

r

Solution

strsplit gives you back a list of the character vectors, so if you want it in a single vector, use unlist as well. So,

    unlist(strsplit(string, ","))

Problem

I have a string in R in the following form: ``` "AAAAA","BBBBB","CCCCC",.. ``` And i want to convert it to a standard typical R vector containing the same string elements ("AAAAA", "BBBBB", etc.): ``` vector<-c("AAAAA","BBBBB","CCCCC",..) ``` I've read that `strsplit` could do it, but haven't managed to achieve it.

Original source

Related problems