Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR R

how to itterate through a character in r

numberstring <- "0123456789"

numberstring_split <- strsplit(numberstring, "")[[1]]

for (number in numberstring_split) {
  print(number)
}
# [1] "0"
# [1] "1"
# [1] "2"
# [1] "3"
# [1] "4"
# [1] "5"
# [1] "6"
# [1] "7"
# [1] "8"
# [1] "9"
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #itterate #character
ADD COMMENT
Topic
Name
1+2 =