R how to get a list of characters in a string

character, r, string

Solution

You can do:

strsplit('abc','')[[1]]

Problem

In R how could i get list of characters that are contained in a string. I have provided an example below ``` somefunction("abc") should return "a","b","c" ``` =============================update1 I am planning to get all the characters, sort them and join them back. I tried paste function but it didnt work :( Any inputs? ``` sort(strsplit('cba','')[[1]]) paste(sort(strsplit('cba','')[[1]])) ```

Original source