R: print string character
R: print string character
Peter Lin
2018/4/5
Using stringi (str_sub) & stringr (str_count) package
library(stringi)
x="apple"
library(stringr)
n=str_count(x)
for (i in 1:n ){print(str_sub(x,i,i))}
## [1] "a"
## [1] "p"
## [1] "p"
## [1] "l"
## [1] "e"