transferParentToChild: Function to transfer values from parent to child.

Description Usage Arguments Details Value

Description

When values transferred between parent and child, shares are applied. To transfer parent to children, we multiply by the share in order to obtain the share of parents used to produce the child commodity. In the reversed direction, the values are divided by the shares.

Usage

1
2
3
transferParentToChild(parentData, childData, mappingTable,
  parentToChild = TRUE, transferMethodFlag = "c",
  imputationObservationFlag = "I")

Arguments

parentData

The data for animal commodity.

childData

The data for meat commodity.

mappingTable

The mapping table between the parent and the child.

parentToChild

logical, if true, slaughtered animal are transferred from animal commodity to meat, otherwise the otherway around.

transferMethodFlag

The method flag to be assigned for the transfer.

imputationObservationFlag

This is the flag assigned to imputation. This is a special case when share is zero, then the observation status flag should not be the same as the parent.

Details

An outer merge is applied for all the merge, this is to ensure no values are omitted. Three different type of matching occur as a result and they are:

  1. 1. Value available in origin but not in targetIn this case, the target is filled with the new calculated value.

  2. 2. Value present in origin and in targetIn this case, the target cell is replaced with the new calculated value.

  3. 3. Value present in target but not in originThe value in the target is retained.

Value

An updated dataset depending on the direction of the transfer. The output dataset is strictly greater than the original target dataset.


ncwanner/Production_Validation documentation built on May 8, 2019, 1:48 p.m.