Running examples in ‘mi-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: 02missing_data.frame
> ### Title: Class "missing_data.frame"
> ### Aliases: 02missing_data.frame missing_data.frame-class
> ###   missing_data.frame
> ### Keywords: classes manip AimedAtUseRs
> 
> ### ** Examples
> 
> # STEP 0: Get data
> data(CHAIN, package = "mi")
> 
> # STEP 1: Convert to a missing_data.frame
> mdf <- missing_data.frame(CHAIN) # warnings about missingness patterns
NOTE: The following pairs of variables appear to have the same missingness pattern.
 Please verify whether they are in fact logically distinct variables.
     [,1]      [,2]       
[1,] "age"     "healthy"  
[2,] "age"     "mental"   
[3,] "age"     "treatment"
[4,] "healthy" "mental"   
[5,] "healthy" "treatment"
[6,] "mental"  "treatment"
Warning in .local(.Object, ...) :
  Some observations are missing on all included variables.
Often, this indicates a more complicated model is needed for this missingness mechanism
> show(mdf)
Object of class missing_data.frame with 532 observations on 7 variables

There are 9 missing data patterns

Append '@patterns' to this missing_data.frame to access the corresponding pattern for every observation or perhaps use table()

                         type missing method  model
log_virus          continuous     179    ppd linear
age                continuous      24    ppd linear
income             continuous      38    ppd linear
healthy            continuous      24    ppd linear
mental                 binary      24    ppd  logit
damage    ordered-categorical      63    ppd ologit
treatment ordered-categorical      24    ppd ologit

               family     link transformation
log_virus    gaussian identity    standardize
age          gaussian identity    standardize
income       gaussian identity    standardize
healthy      gaussian identity    standardize
mental       binomial    logit           <NA>
damage    multinomial    logit           <NA>
treatment multinomial    logit           <NA>
> 
> # STEP 2: change things
> mdf <- change(mdf, y = "log_virus", what = "transformation", to = "identity")
> 
> # STEP 3: look deeper
> summary(mdf)
   log_virus           age            income          healthy     
 Min.   : 0.000   Min.   :21.00   Min.   : 1.000   Min.   :16.67  
 1st Qu.: 0.000   1st Qu.:37.00   1st Qu.: 2.000   1st Qu.:35.00  
 Median : 0.000   Median :43.00   Median : 3.000   Median :45.37  
 Mean   : 4.324   Mean   :42.56   Mean   : 3.377   Mean   :44.40  
 3rd Qu.: 9.105   3rd Qu.:48.00   3rd Qu.: 5.000   3rd Qu.:54.89  
 Max.   :13.442   Max.   :70.00   Max.   :10.000   Max.   :70.11  
 NA's   :179      NA's   :24      NA's   :38       NA's   :24     
     mental           damage        treatment     
 Min.   :0.0000   Min.   :1.000   Min.   :0.0000  
 1st Qu.:0.0000   1st Qu.:3.000   1st Qu.:0.0000  
 Median :0.0000   Median :4.000   Median :1.0000  
 Mean   :0.2717   Mean   :3.578   Mean   :0.8602  
 3rd Qu.:1.0000   3rd Qu.:5.000   3rd Qu.:2.0000  
 Max.   :1.0000   Max.   :5.000   Max.   :2.0000  
 NA's   :24       NA's   :63      NA's   :24      
> hist(mdf)
> image(mdf)
> 
> # STEP 4: impute
> ## Not run: 
> ##D imputations <- mi(mdf)
> ## End(Not run)
> 
> ## An example with subsetting on a fully observed variable
> data(nlsyV, package = "mi")
> mdfs <- missing_data.frame(nlsyV, favor_positive = TRUE, favor_ordered = FALSE, by = "first")
Error in nrow(y) : object 'y' not found
Calls: missing_data.frame ... by.data.frame -> structure -> eval -> eval -> tapply -> nrow
Execution halted