- using R version 4.4.3 (2025-02-28 ucrt)
- using platform: x86_64-w64-mingw32
- R was compiled by
gcc.exe (GCC) 13.3.0
GNU Fortran (GCC) 13.3.0
- running under: Windows Server 2022 x64 (build 20348)
- using session charset: UTF-8
- checking for file 'batchtma/DESCRIPTION' ... OK
- this is package 'batchtma' version '0.1.6'
- package encoding: UTF-8
- 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 hidden files and directories ... OK
- checking for portable file names ... OK
- checking whether package 'batchtma' can be installed ... OK
See the install log for details.
- checking installed package size ... OK
- checking package directory ... 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 ... [2s] OK
- checking whether the package can be loaded with stated dependencies ... [2s] OK
- checking whether the package can be unloaded cleanly ... [2s] OK
- checking whether the namespace can be loaded with stated dependencies ... [2s] OK
- checking whether the namespace can be unloaded cleanly ... [2s] OK
- checking loading without being on the library search path ... [2s] 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 ... [6s] OK
- checking Rd files ... [1s] OK
- checking Rd metadata ... 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 installed files from 'inst/doc' ... OK
- checking files in 'vignettes' ... OK
- checking examples ... [4s] ERROR
Running examples in 'batchtma-Ex.R' failed
The error most likely occurred in:
> ### Name: adjust_batch
> ### Title: Adjust for batch effects
> ### Aliases: adjust_batch
>
> ### ** Examples
>
> # Data frame with two batches
> # Batch 2 has higher values of biomarker and confounder
> df <- data.frame(
+ tma = rep(1:2, times = 10),
+ biomarker = rep(1:2, times = 10) +
+ runif(max = 5, n = 20),
+ confounder = rep(0:1, times = 10) +
+ runif(max = 10, n = 20)
+ )
>
> # Adjust for batch effects
> # Using simple means, ignoring the confounder:
> adjust_batch(
+ data = df,
+ markers = biomarker,
+ batch = tma,
+ method = simple
+ )
tma biomarker confounder biomarker_adj2
1 1 2.327543 9.3470523 2.916216
2 2 3.860619 3.1214252 3.271947
3 1 3.864267 6.5167377 4.452939
4 2 6.541039 2.2555510 5.952366
5 1 2.008410 2.6722067 2.597082
6 2 6.491948 4.8611409 5.903276
7 1 5.723376 0.1339033 6.312049
8 2 5.303989 4.8238796 4.715316
9 1 4.145570 8.6969085 4.734243
10 2 2.308931 4.4034900 1.720259
11 1 2.029873 4.8208012 2.618546
12 2 2.882784 6.9956583 2.294111
13 1 4.435114 4.9354131 5.023787
14 2 3.920519 2.8621760 3.331846
15 1 4.849207 8.2737332 5.437880
16 2 4.488496 7.6846674 3.899824
17 1 4.588093 7.9423986 5.176765
18 2 6.959530 2.0794363 6.370858
19 1 2.900176 7.2371095 3.488849
20 2 5.887226 5.1127443 5.298553
> # Returns data set with new variable "biomarker_adj2"
>
> # Use quantile regression, include the confounder,
> # change suffix of returned variable:
> adjust_batch(
+ data = df,
+ markers = biomarker,
+ batch = tma,
+ method = quantreg,
+ confounders = confounder,
+ suffix = "_batchadjusted"
+ )
Error in `purrr::map()`:
ℹ In index: 1.
Caused by error in `dplyr::filter()`:
ℹ In argument: `dplyr::across(dplyr::all_of("confounder"),
~!is.na(.x))`.
Caused by error:
! `..1` must be a logical vector, not a <tbl_df/tbl/data.frame> object.
ℹ If you used `across()` to generate this data frame, please use `if_any()` or
`if_all()` instead.
Backtrace:
▆
1. ├─batchtma::adjust_batch(...)
2. │ ├─purrr::map(...)
3. │ │ └─purrr:::map_("list", .x, .f, ..., .progress = .progress)
4. │ │ ├─purrr:::with_indexed_errors(...)
5. │ │ │ └─base::withCallingHandlers(...)
6. │ │ ├─purrr:::call_with_cleanup(...)
7. │ │ └─batchtma (local) .f(.x[[i]], ...)
8. │ │ └─... %>% ...
9. │ └─data %>% ...
10. ├─dplyr::mutate(...)
11. ├─tidyr::nest(., data = dplyr::everything())
12. ├─dplyr::mutate(., .batchvar = factor_drop(.data$.batchvar))
13. ├─dplyr::filter(., !is.na(.data$variable))
14. ├─dplyr::rename(...)
15. ├─dplyr::filter(...)
16. ├─dplyr:::filter.data.frame(...)
17. │ └─dplyr:::filter_impl(...)
18. │ └─dplyr:::filter_rows(...)
19. │ └─dplyr:::filter_eval(...)
20. │ ├─base::withCallingHandlers(...)
21. │ └─mask$eval_all_filter(dots_expanded, invert, env_filter)
22. │ └─dplyr (local) eval()
23. ├─dplyr:::dplyr_internal_error(...)
24. │ └─rlang::abort(class = c(class, "dplyr:::internal_error"), dplyr_error_data = data)
25. │ └─rlang:::signal_abort(cnd, .file)
26. │ └─base::signalCondition(cnd)
27. └─dplyr (local) `<fn>`(`<dpl:::__>`)
28. └─rlang::abort(message, class = error_class, parent = parent, call = error_call)
Execution halted
- checking for unstated dependencies in vignettes ... OK
- checking package vignettes ... OK
- checking re-building of vignette outputs ... [10s] ERROR
Error(s) in re-building vignettes:
--- re-building 'batchtma.Rmd' using rmarkdown
Quitting from batchtma.Rmd:115-120 [unnamed-chunk-10]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<error/purrr_error_indexed>
Error in `purrr::map()`:
ℹ In index: 1.
Caused by error in `dplyr::filter()`:
ℹ In argument: `dplyr::across(dplyr::all_of(confounders), ~!is.na(.x))`.
Caused by error:
! `..1` must be a logical vector, not a <tbl_df/tbl/data.frame> object.
ℹ If you used `across()` to generate this data frame, please use `if_any()` or
`if_all()` instead.
---
Backtrace:
▆
1. ├─... %>% ...
2. ├─batchtma::plot_batch(...)
3. │ ├─dplyr::n_distinct(...)
4. │ │ └─vctrs::df_list(...)
5. │ │ └─rlang::list2(...)
6. │ └─dplyr::select(...)
7. ├─batchtma::adjust_batch(...)
8. │ └─batchtma:::batchmean_ipw(...)
9. │ ├─purrr::map(...)
10. │ │ └─purrr:::map_("list", .x, .f, ..., .progress = .progress)
11. │ │ ├─purrr:::with_indexed_errors(...)
12. │ │ │ └─base::withCallingHandlers(...)
13. │ │ ├─purrr:::call_with_cleanup(...)
14. │ │ └─batchtma (local) .f(.x[[i]], ...)
15. │ │ └─... %>% ...
16. │ └─data %>% ...
17. ├─dplyr::mutate(., .batchvar = factor_drop(.data$.batchvar))
18. ├─dplyr::filter(., !is.na(.data$variable))
19. ├─dplyr::rename(., variable = dplyr::one_of(variable))
20. ├─dplyr::filter(., dplyr::across(dplyr::all_of(confounders), ~!is.na(.x)))
21. ├─dplyr:::filter.data.frame(., dplyr::across(dplyr::all_of(confounders), ~!is.na(.x)))
22. │ └─dplyr:::filter_impl(...)
23. │ └─dplyr:::filter_rows(...)
24. │ └─dplyr:::filter_eval(...)
25. │ ├─base::withCallingHandlers(...)
26. │ └─mask$eval_all_filter(dots_expanded, invert, env_filter)
27. │ └─dplyr (local) eval()
28. └─dplyr:::dplyr_internal_error(...)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: processing vignette 'batchtma.Rmd' failed with diagnostics:
ℹ In index: 1.
Caused by error in `dplyr::filter()`:
ℹ In argument: `dplyr::across(dplyr::all_of(confounders), ~!is.na(.x))`.
Caused by error:
! `..1` must be a logical vector, not a <tbl_df/tbl/data.frame> object.
ℹ If you used `across()` to generate this data frame, please use `if_any()` or
`if_all()` instead.
--- failed re-building 'batchtma.Rmd'
SUMMARY: processing the following file failed:
'batchtma.Rmd'
Error: Vignette re-building failed.
Execution halted
- checking PDF version of manual ... [19s] OK
- checking HTML version of manual ... [1s] OK
- DONE
Status: 2 ERRORs