standardize: Standardize

Description Usage Arguments Details Value

Description

This function standardizes the SUA level commodities using the logic implemented by Marteen Van't Reet in "Flexible Aggregation of FAO's Supply Utilization Accounts."

This function standardizes the SUA level commodities using the logic implemented by Marteen Van't Reet in "Flexible Aggregation of FAO's Supply Utilization Accounts."

Usage

1
2
3
4
5
6
7
standardize(aupusData, fbsElements = c(51, 61, 91, 101, 111, 121, 141, 151,
  71), calorieElements = c(261, 271, 281), productionElement = 51, fbsTree,
  suaTree)

standardize(aupusData, fbsElements = c(51, 61, 91, 101, 111, 121, 141, 151,
  71), calorieElements = c(261, 271, 281), productionElement = 51, fbsTree,
  suaTree)

Arguments

aupusData

A list of two data.table objects, the names of which should be "nodes" and "edges". This object thus contains the AUPUS data. This object is usually the output from the Aupus function.

fbsElements

The element codes for nodes that should be standardized. These correspond to the different "elements" of the FBS, such as production, imports, exports, etc. Usually the default value will not need to be modified (it has production (51), imports (61), exports (91), feed (101), seed (111), waste (121), food (141), industrial uses (151), and to stocks (71)).

calorieElements

The numeric codes for the elements which should be standardized via simple addition (i.e. calories, proteins, fats)

productionElement

The numeric code for production. This code should be specified separately as it is not standardized.

fbsTree

The commodity tree which specifies how a commodityID (the commodity code) aggregates to the FBS aggregates (fbsID4 < fbsID3 < fbsID2 < fbsID1). Additionally, conversionFactor is a column which specifies how items are rolled up, and is almost always 1. Generally loaded from a file.

suaTree

The tree specifying how commodities should be standardized in the SUA. Required columns are childID, parentID (both commodity codes), extractionRate, target (a flag indicating forward or backward standardization, or none) and calorieExtractionRate. Generally loaded from a file.

aupusData

A list of two data.table objects, the names of which should be "nodes" and "edges". This object thus contains the AUPUS data. This object is usually the output from the Aupus function.

fbsElements

The element codes for nodes that should be standardized. These correspond to the different "elements" of the FBS, such as production, imports, exports, etc. Usually the default value will not need to be modified (it has production (51), imports (61), exports (91), feed (101), seed (111), waste (121), food (141), industrial uses (151), and to stocks (71)).

calorieElements

The numeric codes for the elements which should be standardized via simple addition (i.e. calories, proteins, fats)

productionElement

The numeric code for production. This code should be specified separately as it is not standardized.

fbsTree

The commodity tree which specifies how a commodityID (the commodity code) aggregates to the FBS aggregates (fbsID4 < fbsID3 < fbsID2 < fbsID1). Additionally, conversionFactor is a column which specifies how items are rolled up, and is almost always 1. Generally loaded from a file.

suaTree

The tree specifying how commodities should be standardized in the SUA. Required columns are childID, parentID (both commodity codes), extractionRate, target (a flag indicating forward or backward standardization, or none) and calorieExtractionRate. Generally loaded from a file.

Details

Below are some comments of interest about standardization. These decisions may seem arbitrary, but they were made to cause agreement between the numbers produced from the R standardization and the existing FAOSTAT numbers.

Below are some comments of interest about standardization. These decisions may seem arbitrary, but they were made to cause agreement between the numbers produced from the R standardization and the existing FAOSTAT numbers.

Value

A list of two elements: suaOutput and fbsOutput. The first, suaOutput, is a data.table with the SUA data standardized back to the primary commodity. The second, fbsOutput, is a list of four data.tables, each of the same format as suaOutput. The first element of this list is suaOutput standardized to the first FBS level, the second element is the second FBS level, etc. Higher FBS levels simply group more commodities together.

A list of two elements: suaOutput and fbsOutput. The first, suaOutput, is a data.table with the SUA data standardized back to the primary commodity. The second, fbsOutput, is a list of four data.tables, each of the same format as suaOutput. The first element of this list is suaOutput standardized to the first FBS level, the second element is the second FBS level, etc. Higher FBS levels simply group more commodities together.


SWS-Methodology/faoswsAupus documentation built on May 9, 2019, 11:45 a.m.