rev_sentence | R Documentation |
Reverse the order of words in a string
rev_sentence(vec, split = " |_", join = " ")
vec |
(Character) The vector to reverse. |
split |
(Character) A regular expression that determines where |
join |
(Character) A string that will be inserted between the words. |
A character vector that is the same length as vec
.
Desi Quintans (http://www.desiquintans.com)
vec <- c("Lorem ipsum dolor",
"sit amet, consectetur",
"adipiscing elit, sed",
"do eiusmod tempor",
"incididunt ut labore",
"et dolore magna",
"aliqua.")
rev_sentence(vec)
## [1] "dolor ipsum Lorem" "consectetur amet, sit" "sed elit, adipiscing"
## [4] "tempor eiusmod do" "labore ut incididunt" "magna dolore et" "aliqua."
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.