Description Usage Arguments Details Value Author(s) References See Also Examples
Reverses the characters in a character string, unless a vector is supplied, in which case reverses the element of the vector.
1 | revchar(x)
|
x |
A character vector (typically of length 1). |
When a character vector of length > 1 is provided, reverses the elements of the vector, not the characters itself.
A vector.
Remko Duursma
None.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## Not run:
# Take a substring, counting from the end:
substrfromend <- function(x,start,stop)revchar(substr(revchar(x),start,stop))
substrfromend('filename.txt', 1,3)
# Check if a word is a palindrome:
s <- 'saippuakivikauppias'
s == revchar(s)
# A semordnilap:
cat('I am so stressed, I need to eat', revchar('stressed'),'\n')
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.