calculateDailyNutritive: Calculate Daily Nutritive (Calories, Proteins, and Fats)

Description Usage Arguments Details Value

Description

This function converts total calories/proteins/fats to daily per person calories/proteins/fats. The calculation for each case is identical, and thus the logic is implemented in this one function. The calculation is straightforward, although there is a multiplicative adjustment of 1000: E_264 = E_261 * 1000 / (365 * Population) E_274 = E_271 * 1000 / (365 * Population) E_284 = E_281 * 1000 / (365 * Population) (261/264 is calories/calories per day, 271/274 is for proteins, 281/284 is for fats).

Usage

1
2
calculateDailyNutritive(population11Num, population21Num, dailyElement,
  totalElement, data, aupusParam)

Arguments

population11Num

The column corresponds to element 11 of the population.

population21Num

The column corresponds to element 21 of the population.

dailyElement

The element number for the daily element. Currently, this should be one of 264, 274, or 284.

totalElement

The element number for the total element. Currently, this should be one of 261, 271, or 281.

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

Population is extracted from the population commodity's element 21 (FBS population). If this element is missing, it uses the population commodity's element 11 (initial existence).

Note: this function is a replacement for calculateEle264, calculateEle274, and calculateEle284.

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 264/274/284's value and symbol updated.


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