Let\'s say that I have a string \"rrkn\". Is there a function in R that\'ll return a vector \"r\", \"k\", \"n\" (i.e. eac
\"rrkn\"
\"r\"
\"k\"
\"n\"
If you want to make it slightly less cumbersome to type:
uniqchars <- function(x) unique(strsplit(x, "")[[1]])
Another solution to use rawToChar(unique(charToRaw(x))).
rawToChar(unique(charToRaw(x)))