Description Usage Arguments Details Warning Examples
perc_change
returns the percentage change between two values, where one
value (old.value
) is used as a baseline to compare the change with.
1 | perc_change(old.value, new.value, print.result = "value")
|
old.value |
(numeric) The baseline for the comparison. |
new.value |
(numeric) The value which is compared to the baseline. |
print.result |
(character) Either "value", "percentage", or "text". |
The output can be specified via the print.result
parameter. Options are
the raw value, transformed to percentage, or a text description. Default
settings return the raw value.
perc_change
is vectorized and shorter values are
recycled. If the length of old.value
differs from the length of
print.result
, please confirm that the code is doing the desired task
by double-checking with print.result = "text".
1 | perc_change(7, 5, print.result = "text")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.