Description Usage Arguments Details Value See Also Examples
Abbreviates strings by (optionally) tokenizing and matching token against a dictionary
1 2 | abbreviate(string, dict = getOption("abbreviations", abbreviations),
tokenizer = NULL)
|
string |
character; string to attempt to abbreviate |
dict |
dictionary-like object; uses global options
'confirm.abbreviations' or else the |
tokenizer |
character; pattern passed to
|
abbreviate
works by first finding a list of tokens that occur in the
code.
x can be adorned with match modifiers to control the type of match. See
lookup
for details.
If there is no matching entry for the token in the dictinary, no substitution is used.
character; string with elements matching dict
replaced
lookup
abbreviations
str_split
1 2 3 4 5 6 7 8 9 10 | string <- c( 'foo bar', 'foo amount', 'amount', 'amount count date' )
# Attempts to abreviate entire string
abbreviate(string)
# Tokenizes sting and matches against the token
abbreviate(string, tokenizer=" ")
abbreviate( c('product_year', "dollar_range"), abbreviations, tokenizer = '_')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.