Description Usage Arguments Details Value Examples
Converts a list of decimal numbers (e.g. 0.7, 1.0, 1.3) to their corresponding percent difference representation. The representation will depend on what value is selected as the baseline, i.e. 0% percent change.
1 | to_percent_change(decimal_list, baseline = 1)
|
decimal_list |
The list to convert. |
baseline |
The value that represents 0% percent change. |
This function uses round() to avoid any weird floating point representation errors. Because of this, the best precision you can obtain is integers for your percent differences (e.g. can only get "52
A list of the same length as decimal_list.
1 2 3 4 | ## Not run: to_percent_change(seq(0.5,1.5,by=0.1))
to_percent_change(seq(-0.3,0.7,by=0.1),baseline=0)
to_percent_change(seq(0.512,1.512,by=0.1)) # answer is rounded
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.