I've wrote code that does this:
text <- "abcdef"
substring(text, first = (1:(nchar(text)/2)) * 2 - 1, last = (1:(nchar(text)/2)) * 2)
Result:
"ab" "cd" "ef"
It works perfecty for small sized Strings but not for long ones.
Any suggestion, how I can do it faster?