imputeAreaSown: Get the area harvested/sown data

Description Usage Arguments Value

View source: R/imputeAreaSown.R

Description

Imputation is currently quite simple: if the area sown variable has no data, then area sown is assumed to be equal to area harvested. If some values exist and some are missing, than an average ratio is computed of area sown to area harvested and this ratio is applied to all missing values.

Usage

1
2
3
imputeAreaSown(data, codeAreaHarvested = "5312", codeAreaSown = "5025",
  imputedObsFlag = "I", imputedMethodFlag = "e", byKey = NULL,
  imputationParameters = NULL)

Arguments

data

The data.table object containing the seed data, usually as created by getAreaData.

codeAreaHarvested

The element code for the area harvested variable.

codeAreaSown

The element code for the area sown variable.

imputedObsFlag

The value to be assigned to the observation status flag for imputed observations.

imputedMethodFlag

The value to be assigned to the method flag for imputed observations.

byKey

Only used if imputationParameters is NULL (if imputationParameters is not NULL, ensemble imputation is performed and the byKey variable should be specified in this list). This value specifies how the mean seed to harvest ratio should be computed: by country, globally, or in some other way. Should be a column name of data, or NULL (in which case a global mean is used).

imputationParameters

A vector containing the parameters to use in the imputation of areaSown variable. If NULL, imputation is done by computing the mean ratio of area harvested to area sown and applying that to all cases. See faoswsImputation::defaultImputationParameters()

Value

No object is returned, instead the underlying data.table object is modified.


SWS-Methodology/faoswsSeed documentation built on Nov. 21, 2020, 5:43 p.m.