Reconstructs one or more completed datasets by filling in imputed values from the specified imputation(s).

# S3 method for class 'vimmi'
complete(data, action = 1, ...)

Arguments

data

A vimmi object (produced by vimpute with m > 1)

action

Specifies which completed dataset(s) to return:

  • Integer (1..m): return a single completed data.frame for that imputation

  • "all": return a named list of all m completed data.frames

  • "long": return a single data.frame in long format with .imp (imputation number) and .id (row number) columns

...

Currently unused

Value

A data.frame, list of data.frames, or long-format data.frame

Examples

if (FALSE) { # \dontrun{
result <- vimpute(sleep, method = "ranger", m = 5, boot = TRUE, uncert = "normalerror")
d1 <- complete(result, 1)        # first completed dataset
all_d <- complete(result, "all")  # list of 5 datasets
long_d <- complete(result, "long") # long format with .imp column
} # }