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]]))
You can do:
strsplit('abc','')[[1]]
You could try
paste(sort(strsplit('cba','')[[1]]), collapse='')
#[1] "abc"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With