View source: R/substrRight_function.R
substrRight | R Documentation |
This function returns a portion of a string, counted from the right-hand margin. Useful for strings of uneven length where the trailing digits are of interest. This function is similar to base::substr() except that the offset if counted from the right.
substrRight(x, n, k)
x |
a vector, if not a character vector, will be coerced using as.character |
n |
the number of elements from the right margin to start counting from |
k |
the number of elements to include in the resulting string |
substr("abcdef", 2, 4)
substrRight(X, 3, 2)
X <- c(3846250)
substrRight(X, 4, 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.