Description Usage Arguments Details
This function is used repeatedly in the query calcultions above. It calculates shares of a total value, where the total value is calculated using an aggregation by Units, scenario, forcing, branch, year, region.
1 |
key |
string, single key found in unique(df$column) |
column |
unquoted column name, name of column that contains set of all possible keys |
df |
data.frame, contains "Land Allocation" data from Comparison Figures object |
The output contains shares of the total for only one key. To get the shares calculated for all keys, we would grab the set of unique keys, lapply over them, and unlist:
sharesForAllKeys <- lapply(keys, calcshare, column, df) bind_rows()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.