Description Usage Arguments Value
View source: R/imputeAreaSown.R
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.
1 2 3 | imputeAreaSown(data, codeAreaHarvested = "5312", codeAreaSown = "5025",
imputedObsFlag = "I", imputedMethodFlag = "e", byKey = NULL,
imputationParameters = NULL)
|
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() |
No object is returned, instead the underlying data.table object is modified.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.