I\'m trying to teach myself R and in doing some sample problems I came across the need to reverse a string.
Here\'s what I\'ve tried so far but the paste operation d
stringi has had this function for quite a long time:
stringi
stringi::stri_reverse("abcdef") ## [1] "fedcba"
Also note that it's vectorized:
stringi::stri_reverse(c("a", "ab", "abc")) ## [1] "a" "ba" "cba"