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. each unique character in the string)?
"rrkn"
"r"
"k"
"n"
If you want to make it slightly less cumbersome to type:
uniqchars <- function(x) unique(strsplit(x, "")[[1]])
1.4m articles
1.4m replys
5 comments
57.0k users