miDiscard(x)
x
, but with multiple imputations discarded.
If
x
is an
miVariable
object, this function returns the
Data
slot, dropping the
Imputations
and
whichNA
components.
The missing values in the original data remain.
If
x
is an
miList
or list object, it is (recursively) converted
to
miVariable
objects, which then have imputations discarded.
An error occurs if this is not possible, e.g. because data
differs in length across imputations.
x <- miDiscard(cholesterolImpExample) cholesterolImpExample[[3]] x[[3]] # Multiple imputations are discarded miDiscard(crimeImpExample) # frequency is now NA # An example where discarding imputations is not possible x <- as.miList(cholesterolImpExample[[3]]) length(x[[1]]) <- 8 # Now imputations have different lengths # miDiscard(x) # Would fail, cannot discard imputations.