ggmice
ggmice copied to clipboard
The `plot_pattern()` function produces a non-informative error when complete data is supplied
Problem:
ggmice::plot_pattern(na.omit(mice::boys))
#> /\ /\
#> { `---' }
#> { O O }
#> ==> V <== No need for mice. This data set is completely observed.
#> \ \|/ /
#> `-----'
#> Error in `stop_subscript()`:
#> ! Can't subset columns that don't exist.
#> x Columns `age`, `hgt`, `wgt`, `bmi`, `hc`, etc. don't exist.
Created on 2022-04-05 by the reprex package (v2.0.1)
Solution: add a return()
in the preprocessing part of the function to exit the function immediately whenever the data is complete