- using R Under development (unstable) (2025-12-18 r89199)
- using platform: x86_64-pc-linux-gnu
- R was compiled by
gcc-15 (Debian 15.2.0-11) 15.2.0
GNU Fortran (Debian 15.2.0-11) 15.2.0
- running under: Debian GNU/Linux forky/sid
- using session charset: UTF-8
- checking for file ‘miceFast/DESCRIPTION’ ... OK
- this is package ‘miceFast’ version ‘0.8.5’
- package encoding: UTF-8
- checking CRAN incoming feasibility ... [1s/1s] OK
- checking package namespace information ... OK
- checking package dependencies ... OK
- checking if this is a source package ... OK
- checking if there is a namespace ... OK
- checking for executable files ... OK
- checking for hidden files and directories ... OK
- checking for portable file names ... OK
- checking for sufficient/correct file permissions ... OK
- checking whether package ‘miceFast’ can be installed ... OK
See the install log for details.
- used C++ compiler: ‘g++-15 (Debian 15.2.0-11) 15.2.0’
- checking package directory ... OK
- checking for future file timestamps ... OK
- checking ‘build’ directory ... OK
- checking DESCRIPTION meta-information ... OK
- checking top-level files ... OK
- checking for left-over files ... OK
- checking index information ... OK
- checking package subdirectories ... OK
- checking code files for non-ASCII characters ... OK
- checking R files for syntax errors ... OK
- checking whether the package can be loaded ... [1s/1s] OK
- checking whether the package can be loaded with stated dependencies ... [1s/1s] OK
- checking whether the package can be unloaded cleanly ... [1s/1s] OK
- checking whether the namespace can be loaded with stated dependencies ... [1s/1s] OK
- checking whether the namespace can be unloaded cleanly ... [1s/1s] OK
- checking loading without being on the library search path ... [1s/1s] OK
- checking use of S3 registration ... OK
- checking dependencies in R code ... OK
- checking S3 generic/method consistency ... OK
- checking replacement functions ... OK
- checking foreign function calls ... OK
- checking R code for possible problems ... [5s/8s] OK
- checking Rd files ... [0s/1s] OK
- checking Rd metadata ... OK
- checking Rd line widths ... OK
- checking Rd cross-references ... OK
- checking for missing documentation entries ... OK
- checking for code/documentation mismatches ... OK
- checking Rd \usage sections ... OK
- checking Rd contents ... OK
- checking for unstated dependencies in examples ... OK
- checking contents of ‘data’ directory ... OK
- checking data for non-ASCII characters ... [0s/0s] OK
- checking LazyData ... OK
- checking data for ASCII and uncompressed saves ... OK
- checking line endings in C/C++/Fortran sources/headers ... OK
- checking line endings in Makefiles ... OK
- checking compilation flags in Makevars ... OK
- checking for GNU extensions in Makefiles ... OK
- checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK
- checking use of PKG_*FLAGS in Makefiles ... OK
- checking use of SHLIB_OPENMP_*FLAGS in Makefiles ... OK
- checking pragmas in C/C++ headers and code ... OK
- checking compilation flags used ... OK
- checking compiled code ... OK
- checking installed files from ‘inst/doc’ ... OK
- checking files in ‘vignettes’ ... OK
- checking examples ... [3s/5s] ERROR
Running examples in ‘miceFast-Ex.R’ failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: fill_NA
> ### Title: 'fill_NA' function for the imputations purpose.
> ### Aliases: fill_NA fill_NA.data.frame fill_NA.data.table fill_NA.matrix
>
> ### ** Examples
>
> library(miceFast)
> library(dplyr)
Attaching package: ‘dplyr’
The following objects are masked from ‘package:stats’:
filter, lag
The following objects are masked from ‘package:base’:
intersect, setdiff, setequal, union
> library(data.table)
Attaching package: ‘data.table’
The following objects are masked from ‘package:dplyr’:
between, first, last
The following object is masked from ‘package:base’:
%notin%
> ### Data
> # airquality dataset with additional variables
> data(air_miss)
> ### Intro: dplyr
> # IMPUTATIONS
> air_miss <- air_miss %>%
+ # Imputations with a grouping option (models are separately assessed for each group)
+ # taking into account provided weights
+ group_by(groups) %>%
+ do(mutate(., Solar_R_imp = fill_NA(
+ x = .,
+ model = "lm_pred",
+ posit_y = "Solar.R",
+ posit_x = c("Wind", "Temp", "Intercept"),
+ w = .[["weights"]]
+ ))) %>%
+ ungroup() %>%
+ # Imputations - discrete variable
+ mutate(x_character_imp = fill_NA(
+ x = .,
+ model = "lda",
+ posit_y = "x_character",
+ posit_x = c("Wind", "Temp")
+ )) %>%
+ # logreg was used because almost log-normal distribution of Ozone
+ # imputations around mean
+ mutate(Ozone_imp1 = fill_NA(
+ x = .,
+ model = "lm_bayes",
+ posit_y = "Ozone",
+ posit_x = c("Intercept"),
+ logreg = TRUE
+ )) %>%
+ # imputations using positions - Intercept, Temp
+ mutate(Ozone_imp2 = fill_NA(
+ x = .,
+ model = "lm_bayes",
+ posit_y = 1,
+ posit_x = c(4, 6),
+ logreg = TRUE
+ )) %>%
+ # multiple imputations (average of x30 imputations)
+ # with a factor independent variable, weights and logreg options
+ mutate(Ozone_imp3 = fill_NA_N(
+ x = .,
+ model = "lm_noise",
+ posit_y = "Ozone",
+ posit_x = c("Intercept", "x_character_imp", "Wind", "Temp"),
+ w = .[["weights"]],
+ logreg = TRUE,
+ k = 30
+ )) %>%
+ mutate(Ozone_imp4 = fill_NA_N(
+ x = .,
+ model = "lm_bayes",
+ posit_y = "Ozone",
+ posit_x = c("Intercept", "x_character_imp", "Wind", "Temp"),
+ w = .[["weights"]],
+ logreg = TRUE,
+ k = 30
+ )) %>%
+ group_by(groups) %>%
+ do(mutate(., Ozone_imp5 = fill_NA(
+ x = .,
+ model = "lm_pred",
+ posit_y = "Ozone",
+ posit_x = c("Intercept", "x_character_imp", "Wind", "Temp"),
+ w = .[["weights"]],
+ logreg = TRUE
+ ))) %>%
+ do(mutate(., Ozone_imp6 = fill_NA_N(
+ x = .,
+ model = "pmm",
+ posit_y = "Ozone",
+ posit_x = c("Intercept", "x_character_imp", "Wind", "Temp"),
+ w = .[["weights"]],
+ logreg = TRUE,
+ k = 20
+ ))) %>%
+ ungroup() %>%
+ # Average of a few methods
+ mutate(Ozone_imp_mix = rowMeans(select(., starts_with("Ozone_imp")))) %>%
+ # Protecting against collinearity or low number of observations - across small groups
+ # Be carful when using a grouping option
+ # because of lack of protection against collinearity or low number of observations.
+ # There could be used a tryCatch(fill_NA(...),error=function(e) return(...))
+ group_by(groups) %>%
+ do(mutate(., Ozone_chac_imp = tryCatch(
+ fill_NA(
+ x = .,
+ model = "lda",
+ posit_y = "Ozone_chac",
+ posit_x = c(
+ "Intercept",
+ "Month",
+ "Day",
+ "Temp",
+ "x_character_imp"
+ ),
+ w = .[["weights"]]
+ ),
+ error = function(e) .[["Ozone_chac"]]
+ ))) %>%
+ ungroup()
>
> # Sample of results
> air_miss[which(is.na(air_miss[, 1]))[1:5], ]
# A tibble: 5 × 23
Ozone Solar.R Wind Temp Day Intercept index weights groups x_character
<dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <fct> <chr>
1 NA NA 14.3 56 5 1 5 0.995 5 <NA>
2 NA 194 8.6 69 10 1 10 0.995 5 (140,210]
3 NA 66 16.6 57 25 1 25 1.01 5 (0,70]
4 NA 266 14.9 58 26 1 26 1.00 5 (210,280]
5 NA NA 8 57 27 1 27 1.000 5 <NA>
# ℹ 13 more variables: Ozone_chac <chr>, Ozone_f <fct>, Ozone_high <lgl>,
# Solar_R_imp <dbl>, x_character_imp <chr>, Ozone_imp1 <dbl>,
# Ozone_imp2 <dbl>, Ozone_imp3 <dbl>, Ozone_imp4 <dbl>, Ozone_imp5 <dbl>,
# Ozone_imp6 <dbl>, Ozone_imp_mix <dbl>, Ozone_chac_imp <chr>
>
> ### Intro: data.table
> # IMPUTATIONS
> # Imputations with a grouping option (models are separately assessed for each group)
> # taking into account provided weights
> data(air_miss)
> setDT(air_miss)
> air_miss[, Solar_R_imp := fill_NA_N(
+ x = .SD,
+ model = "lm_bayes",
+ posit_y = "Solar.R",
+ posit_x = c("Wind", "Temp", "Intercept"),
+ w = .SD[["weights"]],
+ k = 100
+ ), by = .(groups)] %>%
+ # Imputations - discrete variable
+ .[, x_character_imp := fill_NA(
+ x = .SD,
+ model = "lda",
+ posit_y = "x_character",
+ posit_x = c("Wind", "Temp", "groups")
+ )] %>%
+ # logreg was used because almost log-normal distribution of Ozone
+ # imputations around mean
+ .[, Ozone_imp1 := fill_NA(
+ x = .SD,
+ model = "lm_bayes",
+ posit_y = "Ozone",
+ posit_x = c("Intercept"),
+ logreg = TRUE
+ )] %>%
+ # imputations using positions - Intercept, Temp
+ .[, Ozone_imp2 := fill_NA(
+ x = .SD,
+ model = "lm_bayes",
+ posit_y = 1,
+ posit_x = c(4, 6),
+ logreg = TRUE
+ )] %>%
+ # model with a factor independent variable
+ # multiple imputations (average of x30 imputations)
+ # with a factor independent variable, weights and logreg options
+ .[, Ozone_imp3 := fill_NA_N(
+ x = .SD,
+ model = "lm_noise",
+ posit_y = "Ozone",
+ posit_x = c("Intercept", "x_character_imp", "Wind", "Temp"),
+ w = .SD[["weights"]],
+ logreg = TRUE,
+ k = 30
+ )] %>%
+ .[, Ozone_imp4 := fill_NA_N(
+ x = .SD,
+ model = "lm_bayes",
+ posit_y = "Ozone",
+ posit_x = c("Intercept", "x_character_imp", "Wind", "Temp"),
+ w = .SD[["weights"]],
+ logreg = TRUE,
+ k = 30
+ )] %>%
+ .[, Ozone_imp5 := fill_NA(
+ x = .SD,
+ model = "lm_pred",
+ posit_y = "Ozone",
+ posit_x = c("Intercept", "x_character_imp", "Wind", "Temp"),
+ w = .SD[["weights"]],
+ logreg = TRUE
+ ), .(groups)] %>%
+ .[, Ozone_imp6 := fill_NA_N(
+ x = .SD,
+ model = "pmm",
+ posit_y = "Ozone",
+ posit_x = c("Intercept", "x_character_imp", "Wind", "Temp"),
+ w = .SD[["weights"]],
+ logreg = TRUE,
+ k = 10
+ ), .(groups)] %>%
+ # Average of a few methods
+ .[, Ozone_imp_mix := apply(.SD, 1, mean), .SDcols = Ozone_imp1:Ozone_imp6] %>%
+ # Protecting against collinearity or low number of observations - across small groups
+ # Be carful when using a data.table grouping option
+ # because of lack of protection against collinearity or low number of observations.
+ # There could be used a tryCatch(fill_NA(...),error=function(e) return(...))
+
+ .[, Ozone_chac_imp := tryCatch(
+ fill_NA(
+ x = .SD,
+ model = "lda",
+ posit_y = "Ozone_chac",
+ posit_x = c(
+ "Intercept",
+ "Month",
+ "Day",
+ "Temp",
+ "x_character_imp"
+ ),
+ w = .SD[["weights"]]
+ ),
+ error = function(e) .SD[["Ozone_chac"]]
+ ), .(groups)]
Error in `[.data.table`(air_miss, , `:=`(Solar_R_imp, fill_NA_N(x = .SD, :
attempt access index 13/13 in VECTOR_ELT
Calls: %>% -> [ -> [.data.table
Execution halted
- checking for unstated dependencies in ‘tests’ ... OK
- checking tests ... [9s/12s] ERROR
Running ‘testthat.R’ [9s/11s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
> Sys.setenv("OMP_THREAD_LIMIT" = 2)
>
> library(testthat)
> library(miceFast)
> library(data.table)
Attaching package: 'data.table'
The following object is masked from 'package:base':
%notin%
> library(dplyr)
Attaching package: 'dplyr'
The following objects are masked from 'package:data.table':
between, first, last
The following objects are masked from 'package:stats':
filter, lag
The following objects are masked from 'package:base':
intersect, setdiff, setequal, union
> library(magrittr)
Attaching package: 'magrittr'
The following objects are masked from 'package:testthat':
equals, is_less_than, not
>
> test_check("miceFast")
Saving _problems/test-fill_NA_funcs-474.R
Saving _problems/test-fill_NA_funcs-599.R
[ FAIL 2 | WARN 3 | SKIP 0 | PASS 102 ]
══ Failed tests ════════════════════════════════════════════════════════════════
── Error ('test-fill_NA_funcs.R:379:3'): data.table pipeline fill_NA_N, fill_NA accuracy - con ──
Error in ``[.data.table`(data_DT, , `:=`(y_imp, fill_NA(x = .SD, model = "lm_pred", posit_y = "y", posit_x = c("Intercept", "x2", "x3", "x4"), w = .SD[["weights"]])), by = .(group))`: attempt access index 13/13 in VECTOR_ELT
Backtrace:
▆
1. ├─... %>% ... at test-fill_NA_funcs.R:379:3
2. ├─...[]
3. └─data.table:::`[.data.table`(...)
── Error ('test-fill_NA_funcs.R:540:3'): data.table pipeline fill_NA/fill_NA_N accuracy - disc ──
Error in ``[.data.table`(data_DT, , `:=`(y_imp, fill_NA(x = .SD, model = "lda", posit_y = "y_fac", posit_x = c("x2", "x3", "x4", "x5"))), by = .(group))`: attempt access index 16/16 in VECTOR_ELT
Backtrace:
▆
1. ├─... %>% ... at test-fill_NA_funcs.R:540:3
2. ├─...[]
3. └─data.table:::`[.data.table`(...)
[ FAIL 2 | WARN 3 | SKIP 0 | PASS 102 ]
Error:
! Test failures.
Execution halted
- checking for unstated dependencies in vignettes ... OK
- checking package vignettes ... OK
- checking re-building of vignette outputs ... [10s/13s] ERROR
Error(s) in re-building vignettes:
...
--- re-building ‘miceFast-intro.Rmd’ using rmarkdown
Quitting from miceFast-intro.Rmd:221-299 [unnamed-chunk-8]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<error/rlang_error>
Error in `[.data.table`:
! attempt access index 13/13 in VECTOR_ELT
---
Backtrace:
▆
1. ├─... %>% ...
2. ├─...[]
3. └─data.table:::`[.data.table`(...)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: processing vignette 'miceFast-intro.Rmd' failed with diagnostics:
attempt access index 13/13 in VECTOR_ELT
--- failed re-building ‘miceFast-intro.Rmd’
SUMMARY: processing the following file failed:
‘miceFast-intro.Rmd’
Error: Vignette re-building failed.
Execution halted
- checking PDF version of manual ... [4s/6s] OK
- checking HTML version of manual ... [1s/1s] OK
- checking for non-standard things in the check directory ... OK
- DONE
Status: 3 ERRORs