str_rev | R Documentation |
This reverses the individual elements (makes words go backwards, for example), but does not change the order of those elements in the vector.
str_rev(..., USE.NAMES = FALSE)
... |
(Vectors) Vectors that will be coerced to Character and joined together. |
USE.NAMES |
(Logical) Should the output be a named vector, or unnamed? |
A Character vector where every element from the original vectors has been reversed, but the order of the elements within that vector is still the same. NAs remain as NA.
Kevin Ushey (https://stackoverflow.com/users/1342082/kevin-ushey)
https://stackoverflow.com/a/14029000/5578429
vec <- c("Beret", "Clipper", "Cornet", NA)
str_rev(vec)
#> [1] "tereB" "reppilC" "tenroC" NA
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.