calculateShares: calculateShares

Description Usage Arguments Value

View source: R/calculateShares.R

Description

calculateShares

Usage

1
2
calculateShares(data = data, params = p, tree = tree,
  zeroWeight = zeroWeight)

Arguments

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

Value

A data.table containing the final balanced and standardized SUA data. Additionally, this table will have new elements in it if nutrientData was provided.


SWS-Methodology/faoswsStandardization documentation built on Feb. 7, 2022, 5:05 a.m.