add_zero_state | R Documentation |
This function duplicates a dataset, using a variable 'state' to distinguish the two copies: the original version has 'state=1', the copy has 'state=0'.
add_zero_state(df, value)
df |
the dataframe |
value |
the variable that will be reset as zero in the copy dataset. |
The copy also sets 'value = 0' throughout. Useful in conjunction with 'transition_state()'. Eg for a bar plot, state = 1, the actual values, where an animation ends. state = 0, all plotted values set to 0, where an animation starts.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.