trend_terms | R Documentation |
trend_terms()
returns a list object describing the values to
display when x
is greater than y
or x
is less than y
.
trend_terms(more = "increase", less = "decrease")
more |
string to use when x > y |
less |
string to use when x < y |
trend_terms()
will primarily be used in headline()
and passed
along to compare_conditions()
. Similar to plural_phrasing()
Trend terms
can be passed in a list. See examples below.
Returns a list object.
compare_values()
headline( x = c(9, 11), y = 10, headline = "{trend} by {delta_p}%", trend_phrases = trend_terms("higher", "lower") ) # a complex example passing multiple trends and plural phrases headline( 35, 30, headline = "We had {an_increase} of {delta} {people}. That is {delta} {more} {employees} \\ than the same time last year ({orig_values}).", trend_phrases = list( an_increase = trend_terms("an increase", "a decrease"), more = trend_terms("more", "less") ), plural_phrases = list( people = plural_phrasing("person", "people"), employees = plural_phrasing("employee", "employees") ) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.