Description Usage Arguments Value
View source: R/calculateShares.R
calculateShares
1 2 | calculateShares(data = data, params = p, tree = tree,
zeroWeight = zeroWeight)
|
data |
The data.table containing the full dataset for standardization. It should have columns corresponding to year, country, element, commodity, and value. The specific names of these columns should be in params. |
params |
The parameters for standardization. These parameters provide information about the columns of data and tree, specifying (for example) which columns should be standardized, which columns represent parents/children, etc. |
tree |
The commodity tree which details how elements can be processed into other elements. It does not, however, specify which elements get aggregated into others. This data.table should have columns parent, child, extraction rate, share, and target (target specifying if an element is processed forward or not). Names of these columns should be provided in params. |
zeroWeight |
as previously defined |
availability |
Avalaibility as previously calculated |
A data.table containing the final balanced and standardized SUA data. Additionally, this table will have new elements in it if nutrientData was provided.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.