An incredibly basic question in R yet the solution isn't clear.
How to split a vector of character into its individual characters, i.e. the opposite of paste(..., sep='')
or stringr::str_c()
?
Anything less clunky than this:
sapply(1:26, function(i) { substr("ABCDEFGHIJKLMNOPQRSTUVWXYZ",i,i) } )
"A" "B" "C" "D" "E" "F" "G" "H" "I" "J" "K" "L" "M" "N" "O" "P" "Q" "R" "S" "T" "U" "V" "W" "X" "Y" "Z"
Can it be done otherwise, e.g. with strsplit()
, stringr::*
or anything else?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…