Description Usage Arguments Value Examples
utility function to remove n characters from the end of a character string or strings. Extends functional tools available in stringr package for this common operation. Also allows for a set of characters (missing=” by default) to be specified to show that the string was over-truncated.
1 | remove_last_n(str, n = 0, missing = "")
|
str |
the string or vector of strings to be truncated |
n |
the number of characters at the end to remove |
missing |
optional sequence to use if an entry is truncated away (default = ”) |
the string or strings, reduced by n characters
1 2 | remove_last_n('a sequence #', 2)
remove_last_n(c('a couple+','of sequences+'), 1, '...')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.