Last active
August 29, 2015 14:13
-
-
Save ZeccaLehn/30eb3701bb99bd047c27 to your computer and use it in GitHub Desktop.
String to Characters in R -- "Hello World" Function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stringToChar<- function( example ){ | |
example <- as.character(example) | |
letters <- strsplit(example,"")[[1]] | |
for (i in letters[1:length(letters)] ) { print(i) } | |
} | |
## #Uncomment in IDE to run locally. Note URL match. | |
# library(devtools) | |
# source_gist("30eb3701bb99bd047c27") | |
# stringToChar( "Hello Wooorld!" ) | |
# [1] "H" | |
# [1] "e" | |
# [1] "l" | |
# [1] "l" | |
# [1] "o" | |
# [1] " " | |
# [1] "W" | |
# [1] "o" | |
# [1] "o" | |
# [1] "o" | |
# [1] "r" | |
# [1] "l" | |
# [1] "d" | |
# [1] "!" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment