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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: merge_imputations
> ### Title: Merges multiple imputed data frames into a single data frame
> ### Aliases: merge_imputations
> 
> ### ** Examples
> 
> library(mice)
Loading required package: lattice
> imp <- mice(nhanes)

 iter imp variable
  1   1  bmi  hyp  chl
  1   2  bmi  hyp  chl
  1   3  bmi  hyp  chl
  1   4  bmi  hyp  chl
  1   5  bmi  hyp  chl
  2   1  bmi  hyp  chl
  2   2  bmi  hyp  chl
  2   3  bmi  hyp  chl
  2   4  bmi  hyp  chl
  2   5  bmi  hyp  chl
  3   1  bmi  hyp  chl
  3   2  bmi  hyp  chl
  3   3  bmi  hyp  chl
  3   4  bmi  hyp  chl
  3   5  bmi  hyp  chl
  4   1  bmi  hyp  chl
  4   2  bmi  hyp  chl
  4   3  bmi  hyp  chl
  4   4  bmi  hyp  chl
  4   5  bmi  hyp  chl
  5   1  bmi  hyp  chl
  5   2  bmi  hyp  chl
  5   3  bmi  hyp  chl
  5   4  bmi  hyp  chl
  5   5  bmi  hyp  chl
> 
> # return data frame with imputed variables
> merge_imputations(nhanes, imp)
     bmi hyp chl
1  25.88   1 186
2  22.70   1 187
3  29.94   1 187
4  24.30   1 200
5  20.40   1 113
6  22.58   1 184
7  22.50   1 118
8  30.10   1 187
9  22.00   1 238
10 24.08   1 205
11 30.26   1 190
12 24.34   2 197
13 21.70   1 206
14 28.70   2 204
15 29.60   1 176
16 29.46   1 207
17 27.20   2 284
18 26.30   2 199
19 35.30   1 218
20 25.50   2 206
21 29.40   1 201
22 33.20   1 229
23 27.50   1 131
24 24.90   1 222
25 27.40   1 186
> 
> # append imputed variables to original data frame
> merge_imputations(nhanes, imp, nhanes)
   age  bmi hyp chl bmi_imp hyp_imp chl_imp
1    1   NA  NA  NA   25.88       1     186
2    2 22.7   1 187   22.70       1     187
3    1   NA   1 187   29.94       1     187
4    3   NA  NA  NA   24.30       1     200
5    1 20.4   1 113   20.40       1     113
6    3   NA  NA 184   22.58       1     184
7    1 22.5   1 118   22.50       1     118
8    1 30.1   1 187   30.10       1     187
9    2 22.0   1 238   22.00       1     238
10   2   NA  NA  NA   24.08       1     205
11   1   NA  NA  NA   30.26       1     190
12   2   NA  NA  NA   24.34       2     197
13   3 21.7   1 206   21.70       1     206
14   2 28.7   2 204   28.70       2     204
15   1 29.6   1  NA   29.60       1     176
16   1   NA  NA  NA   29.46       1     207
17   3 27.2   2 284   27.20       2     284
18   2 26.3   2 199   26.30       2     199
19   1 35.3   1 218   35.30       1     218
20   3 25.5   2  NA   25.50       2     206
21   1   NA  NA  NA   29.40       1     201
22   1 33.2   1 229   33.20       1     229
23   1 27.5   1 131   27.50       1     131
24   3 24.9   1  NA   24.90       1     222
25   2 27.4   1 186   27.40       1     186
> 
> # show summary of quality of merging imputations
> merge_imputations(nhanes, imp, summary = "dens", filter = c("chl", "hyp"))
Error: Package `ggplot2` needed for to plot summaries. Please install it.
Execution halted