calculateTotalNutritive: Calculate Total Nutritive (Calories, Proteins, Fats)

Description Usage Arguments Details Value

Description

Each commodity has a ratio defined, R_261/R_271/R_281, which gives the conversion rate of the quantity of the commodity in question into calories/proteins/fats. Thus, element 261/271/281 is computed simply as E_261 = E_141 * R_261 / 100

Usage

1
calculateTotalNutritive(ratioNum, elementNum, data, aupusParam)

Arguments

ratioNum

The column name of data corresponding to the ratio for this element. Typically one of "Ratio_measuredElementFS_261" for calories, "Ratio_measuredElementFS_271" for proteins, or "Ratio_measuredElementFS_261" for fats.

elementNum

The element number. Currently, this should be one of 261 (calories), 271 (proteins) or 281 (fats).

data

The AUPUS node dataset, typically as produced by buildNodes.

aupusParam

A list of running parameters to be used in pulling the data. Typically, this is generated from getAupusParameter (see that function for a description of the required elements).

Details

E_271 = E_141 * R_271 / 1000

E_281 = E_141 * R_281 / 1000

Value

This function returns an integer vector containing the row numbers of observations which were updated. However, it also has a side effect: rows within the passed data.table ("data") have element 261/271/281's value and symbol updated.


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