| vim_complete | R Documentation |
Reconstructs one or more completed datasets by filling in imputed values from the specified imputation(s).
vim_complete(data, action = 1, ...)
## S3 method for class 'vimmi'
complete(data, action = 1, ...)
data |
A |
action |
Specifies which completed dataset(s) to return:
|
... |
Currently unused |
vim_complete() is the documented name and always works. The same
function is additionally registered as an S3 method on
mice::complete() and tidyr::complete(), so if either package
is attached the familiar complete(result, 1) dispatches to it.
VIM deliberately does not export a complete() generic of its
own. Both mice and tidyr export a generic of that name, so an
exported VIM generic would mask them (and be masked by them), and would make
any package that imports VIM and one of those packages wholesale emit
“replacing previous import” at load time. Registering the method on
the foreign generics gives the same user-facing call without the clash –
the same approach VIM takes for vim_as_mids.
A data.frame, list of data.frames, or long-format data.frame
## Not run:
result <- vimpute(sleep, method = "ranger", m = 5, boot = TRUE, uncert = "normalerror")
d1 <- vim_complete(result, 1) # first completed dataset
all_d <- vim_complete(result, "all") # list of 5 datasets
long_d <- vim_complete(result, "long") # long format with .imp column
# With mice or tidyr attached, the generic dispatches to the same function:
# library(mice); d1 <- complete(result, 1)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.