plotEnsemble: Plot Ensemble and Model Fits

Description Usage Arguments Value

Description

This function plots each of the individual models in the ensemble as well as the initial data and the final ensemble. This function is not meant to be called directly by the user but instead is a helper function called by ensembleImpute (if the argument plot = TRUE).

Usage

1
2
plotEnsemble(data, modelFits, modelWeights, ensemble, imputationParameters,
  returnFormat = "faceted")

Arguments

data

The data.table containing the data being imputed.

modelFits

A list of length equal to the number of models. Each element of the list should be a numeric vector of length nrow(data). This object is usually created by computeEnsembleFit.

modelWeights

A matrix of dimension nrow(data) x length(modelFits). Each element corresponds to the weight for model/column j and for observation/row i. Note: modelFits and modelWeights need not have the same ordering, but they should have the same names as this is how they are matched.

ensemble

A numeric vector containing either the original data (if it was not missing) or the imputed value (if the original data was missing).

imputationParameters

A list of the parameters for the imputation algorithms. See defaultImputationParameters() for a starting point.

returnFormat

In what format should the plots be returned? If "faceted", a single plot showing with all countries is returned. If "individual", a list with ggplot objects is returned. If "prompt", the first country's plot is displayed and then the user must press ENTER to cycle through the plots.

Value

If returnType = "faceted" or "prompt", then no value is returned (but a plot is generated). However, if returnType = prompt, then a list of ggplot objects is returned.


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