- using R Under development (unstable) (2025-09-03 r88788 ucrt)
- using platform: x86_64-w64-mingw32
- R was compiled by
gcc.exe (GCC) 14.2.0
GNU Fortran (GCC) 14.2.0
- running under: Windows Server 2022 x64 (build 20348)
- using session charset: UTF-8
- checking for file 'simpr/DESCRIPTION' ... OK
- checking extension type ... Package
- this is package 'simpr' version '0.2.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 'simpr' 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 ... [1s] OK
- checking whether the package can be loaded with stated dependencies ... [1s] OK
- checking whether the package can be unloaded cleanly ... [1s] OK
- checking whether the namespace can be loaded with stated dependencies ... [1s] OK
- checking whether the namespace can be unloaded cleanly ... [1s] OK
- checking loading without being on the library search path ... [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 ... [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 ... [12s] ERROR
Running examples in 'simpr-Ex.R' failed
The error most likely occurred in:
> ### Name: fit.simpr_tibble
> ### Title: Fit models to the simulated data
> ### Aliases: fit.simpr_tibble fit.simpr_spec
>
> ### ** Examples
>
> ## Generate data to fit models
> simple_linear_data = specify(a = ~ 2 + rnorm(n),
+ b = ~ 5 + 3*a + rnorm(n, 0, sd = 0.5)) %>%
+ define(n = 100:101) %>%
+ generate(2)
>
> ## Fit with a single linear term
> linear_fit = simple_linear_data %>%
+ fit(linear = ~lm(b ~ a, data = .))
>
> linear_fit # first fit element also prints
full tibble
--------------------------
# A tibble: 4 × 5
.sim_id n rep sim linear
<int> <int> <int> <list> <list>
1 1 100 1 <tibble [100 × 2]> <lm>
2 2 101 1 <tibble [101 × 2]> <lm>
3 3 100 2 <tibble [100 × 2]> <lm>
4 4 101 2 <tibble [101 × 2]> <lm>
sim[[1]]
--------------------------
# A tibble: 100 × 2
a b
<dbl> <dbl>
1 1.82 10.5
2 3.06 14.7
3 4.65 19.4
4 2.30 11.5
5 3.47 15.5
6 1.74 9.84
7 1.51 9.77
8 0.750 7.28
9 2.47 12.4
10 2.29 11.8
# ℹ 90 more rows
linear[[1]]
--------------------------
Call:
lm(formula = b ~ a, data = .)
Coefficients:
(Intercept) a
5.044 2.986
>
> ## Each element of $linear is a model object
> linear_fit$linear
[[1]]
Call:
lm(formula = b ~ a, data = .)
Coefficients:
(Intercept) a
5.044 2.986
[[2]]
Call:
lm(formula = b ~ a, data = .)
Coefficients:
(Intercept) a
5.038 2.980
[[3]]
Call:
lm(formula = b ~ a, data = .)
Coefficients:
(Intercept) a
4.945 3.064
[[4]]
Call:
lm(formula = b ~ a, data = .)
Coefficients:
(Intercept) a
4.929 3.035
>
> ## We can fit multiple models to the same data
> multi_fit = simple_linear_data %>%
+ fit(linear = ~lm(b ~ a, data = .),
+ quadratic = ~lm(b ~ a + I(a^2), data = .))
>
> ## Two columns, one for each model
> multi_fit
full tibble
--------------------------
# A tibble: 4 × 6
.sim_id n rep sim linear quadratic
<int> <int> <int> <list> <list> <list>
1 1 100 1 <tibble [100 × 2]> <lm> <lm>
2 2 101 1 <tibble [101 × 2]> <lm> <lm>
3 3 100 2 <tibble [100 × 2]> <lm> <lm>
4 4 101 2 <tibble [101 × 2]> <lm> <lm>
sim[[1]]
--------------------------
# A tibble: 100 × 2
a b
<dbl> <dbl>
1 1.82 10.5
2 3.06 14.7
3 4.65 19.4
4 2.30 11.5
5 3.47 15.5
6 1.74 9.84
7 1.51 9.77
8 0.750 7.28
9 2.47 12.4
10 2.29 11.8
# ℹ 90 more rows
linear[[1]]
--------------------------
Call:
lm(formula = b ~ a, data = .)
Coefficients:
(Intercept) a
5.044 2.986
quadratic[[1]]
--------------------------
Call:
lm(formula = b ~ a + I(a^2), data = .)
Coefficients:
(Intercept) a I(a^2)
5.055689 2.972430 0.003048
>
> ## Again, each element is a model object
> multi_fit$quadratic
[[1]]
Call:
lm(formula = b ~ a + I(a^2), data = .)
Coefficients:
(Intercept) a I(a^2)
5.055689 2.972430 0.003048
[[2]]
Call:
lm(formula = b ~ a + I(a^2), data = .)
Coefficients:
(Intercept) a I(a^2)
4.95366 3.10635 -0.03204
[[3]]
Call:
lm(formula = b ~ a + I(a^2), data = .)
Coefficients:
(Intercept) a I(a^2)
4.924078 3.096395 -0.008465
[[4]]
Call:
lm(formula = b ~ a + I(a^2), data = .)
Coefficients:
(Intercept) a I(a^2)
4.898686 3.071379 -0.008416
>
> ## Can view terms more nicely with tidy_fits
> multi_fit %>%
+ tidy_fits
# A tibble: 20 × 9
.sim_id n rep Source term estimate std.error statistic p.value
<int> <int> <int> <chr> <chr> <dbl> <dbl> <dbl> <dbl>
1 1 100 1 linear (Interce… 5.04 0.119 42.3 1.02e-64
2 1 100 1 linear a 2.99 0.0510 58.6 4.53e-78
3 1 100 1 quadratic (Interce… 5.06 0.207 24.4 3.90e-43
4 1 100 1 quadratic a 2.97 0.198 15.0 4.14e-27
5 1 100 1 quadratic I(a^2) 0.00305 0.0428 0.0713 9.43e- 1
6 2 101 1 linear (Interce… 5.04 0.112 44.9 1.19e-67
7 2 101 1 linear a 2.98 0.0492 60.5 5.13e-80
8 2 101 1 quadratic (Interce… 4.95 0.142 34.8 5.87e-57
9 2 101 1 quadratic a 3.11 0.140 22.1 6.20e-40
10 2 101 1 quadratic I(a^2) -0.0320 0.0333 -0.962 3.38e- 1
11 3 100 2 linear (Interce… 4.94 0.0959 51.6 7.94e-73
12 3 100 2 linear a 3.06 0.0425 72.2 9.14e-87
13 3 100 2 quadratic (Interce… 4.92 0.132 37.4 1.99e-59
14 3 100 2 quadratic a 3.10 0.147 21.1 5.49e-38
15 3 100 2 quadratic I(a^2) -0.00846 0.0368 -0.230 8.18e- 1
16 4 101 2 linear (Interce… 4.93 0.114 43.3 3.59e-66
17 4 101 2 linear a 3.03 0.0513 59.2 4.24e-79
18 4 101 2 quadratic (Interce… 4.90 0.177 27.7 3.80e-48
19 4 101 2 quadratic a 3.07 0.169 18.2 3.50e-33
20 4 101 2 quadratic I(a^2) -0.00842 0.0370 -0.228 8.20e- 1
>
> ## Can view model summaries with glance_fits
> multi_fit %>%
+ glance_fits
Error in `map()`:
ℹ In index: 1.
ℹ With name: linear.
Caused by error:
ℹ In index: 1.
ℹ With name: 1.
Caused by error in `ll()`:
! could not find function "ll"
Backtrace:
▆
1. ├─multi_fit %>% glance_fits
2. ├─simpr::glance_fits(.)
3. │ ├─simpr::apply_fits(...)
4. │ └─simpr:::apply_fits.simpr_tibble(...)
5. │ └─purrr::map_dfr(...)
6. │ └─purrr::map(.x, .f, ...)
7. │ └─purrr:::map_("list", .x, .f, ..., .progress = .progress)
8. │ ├─purrr:::with_indexed_errors(...)
9. │ │ └─base::withCallingHandlers(...)
10. │ ├─purrr:::call_with_cleanup(...)
11. │ └─simpr (local) .f(.x[[i]], ...)
12. │ └─furrr::future_map_dfr(...)
13. │ └─furrr::future_map(...)
14. │ └─furrr:::furrr_map_template(...)
15. │ └─furrr:::furrr_template(...)
16. │ └─future::future(...)
17. │ ├─future::run(future)
18. │ └─future:::run.Future(future)
19. │ ├─base::tryCatch(...)
20. │ │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
21. │ │ ├─base (local) tryCatchOne(...)
22. │ │ │ └─base (local) doTryCatch(return(expr), name, parentenv, handler)
23. │ │ └─base (local) tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
24. │ │ └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
25. │ │ └─base (local) doTryCatch(return(expr), name, parentenv, handler)
26. │ ├─future::launchFuture(backend, future = future)
27. │ └─future:::launchFuture.SequentialFutureBackend(backend, future = future)
28. │ └─future:::evalFuture(data)
29. │ ├─base::tryCatch(...)
30. │ │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
31. │ │ └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
32. │ │ └─base (local) doTryCatch(return(expr), name, parentenv, handler)
33. │ └─future:::evalFutureInternal(data)
34. │ ├─base::tryCatch(...)
35. │ │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
36. │ │ ├─base (local) tryCatchOne(...)
37. │ │ │ └─base (local) doTryCatch(return(expr), name, parentenv, handler)
38. │ │ └─base (local) tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
39. │ │ └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
40. │ │ └─base (local) doTryCatch(return(expr), name, parentenv, handler)
41. │ ├─base::tryCatch(...)
42. │ │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
43. │ ├─base::withCallingHandlers(...)
44. │ ├─base::withVisible(...)
45. │ └─base::eval(expr, envir = globalenv())
46. │ └─base::eval(expr, envir = globalenv())
47. ├─base::local(...)
48. │ └─base::eval.parent(substitute(eval(quote(expr), envir)))
49. │ └─base::eval(expr, p)
50. │ └─base::eval(expr, p)
51. ├─base::eval(...)
52. │ └─base::eval(...)
53. │ ├─base::do.call(...furrr_map_fn, args)
54. │ └─purrr (local) `<fn>`(.x = `<named list>`, .f = `<fn>`)
55. │ └─purrr:::map_("list", .x, .f, ..., .progress = .progress)
56. │ ├─purrr:::with_indexed_errors(...)
57. │ │ └─base::withCallingHandlers(...)
58. │ ├─purrr:::call_with_cleanup(...)
59. │ └─.f(.x[[i]], ...)
60. │ └─simpr (local) ...furrr_fn(...)
61. │ ├─tibble::as_tibble((purrr::as_mapper(.f))(...))
62. │ ├─(purrr::as_mapper(.f))(...)
63. │ └─broom:::glance.lm(...)
64. │ ├─base::with(...)
65. │ └─base::with.default(...)
66. │ └─base::eval(substitute(expr), data, enclos = parent.frame())
67. │ └─base::eval(substitute(expr), data, enclos = parent.frame())
68. │ └─tibble::tibble(...)
69. │ └─tibble:::tibble_quos(xs, .rows, .name_repair)
70. │ └─rlang::eval_tidy(xs[[j]], mask)
71. ├─stats::AIC(x)
72. ├─stats:::AIC.default(x)
73. └─base::.handleSimpleError(...)
74. └─purrr (local) h(simpleError(msg, call))
75. └─cli::cli_abort(...)
76. └─rlang::abort(...)
Execution halted
- checking for unstated dependencies in 'tests' ... OK
- checking tests ... [41s] ERROR
Running 'testthat.R' [41s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
> library(testthat)
> library(simpr)
Attaching package: 'simpr'
The following object is masked from 'package:stats':
filter
The following objects are masked from 'package:base':
intersect, setdiff, setequal, union
>
> test_check("simpr")
[ FAIL 2 | WARN 1 | SKIP 0 | PASS 48 ]
══ Failed tests ════════════════════════════════════════════════════════════════
── Error ('test_calc_glance.R:7:3'): glance_fits correctly returns broom::glance output ──
<purrr_error_indexed/rlang_error/error/condition>
Error in `(function (.x, .f, ..., .progress = FALSE)
{
map_("list", .x, .f, ..., .progress = .progress)
})(.x = 1, .f = function (...)
{
{
...furrr_chunk_seeds_i <- ...furrr_chunk_seeds_env[["i"]]
...furrr_chunk_seeds_env[["i"]] <- ...furrr_chunk_seeds_i +
1L
assign(x = ".Random.seed", value = ...furrr_chunk_seeds[[...furrr_chunk_seeds_i]],
envir = globalenv(), inherits = FALSE)
}
NULL
...furrr_out <- ...furrr_fn(...)
...furrr_out
})`: ℹ In index: 1.
Caused by error in `ll()`:
! could not find function "ll"
Backtrace:
▆
1. ├─... %>% relocate(.sim_id) at test_calc_glance.R:7:3
2. ├─dplyr::relocate(., .sim_id)
3. ├─dplyr::mutate(., .sim_id = 1)
4. ├─furrr::future_map(...)
5. │ └─furrr:::furrr_map_template(...)
6. │ └─furrr:::furrr_template(...)
7. │ └─future::future(...)
8. │ ├─future::run(future)
9. │ └─future:::run.Future(future)
10. │ ├─base::tryCatch(...)
11. │ │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
12. │ │ ├─base (local) tryCatchOne(...)
13. │ │ │ └─base (local) doTryCatch(return(expr), name, parentenv, handler)
14. │ │ └─base (local) tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
15. │ │ └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
16. │ │ └─base (local) doTryCatch(return(expr), name, parentenv, handler)
17. │ ├─future::launchFuture(backend, future = future)
18. │ └─future:::launchFuture.SequentialFutureBackend(backend, future = future)
19. │ └─future:::evalFuture(data)
20. │ ├─base::tryCatch(...)
21. │ │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
22. │ │ └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
23. │ │ └─base (local) doTryCatch(return(expr), name, parentenv, handler)
24. │ └─future:::evalFutureInternal(data)
25. │ ├─base::tryCatch(...)
26. │ │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
27. │ │ ├─base (local) tryCatchOne(...)
28. │ │ │ └─base (local) doTryCatch(return(expr), name, parentenv, handler)
29. │ │ └─base (local) tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
30. │ │ └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
31. │ │ └─base (local) doTryCatch(return(expr), name, parentenv, handler)
32. │ ├─base::tryCatch(...)
33. │ │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
34. │ ├─base::withCallingHandlers(...)
35. │ ├─base::withVisible(...)
36. │ └─base::eval(expr, envir = globalenv())
37. │ └─base::eval(expr, envir = globalenv())
38. ├─base::local(...)
39. │ └─base::eval.parent(substitute(eval(quote(expr), envir)))
40. │ └─base::eval(expr, p)
41. │ └─base::eval(expr, p)
42. ├─base::eval(...)
43. │ └─base::eval(...)
44. │ ├─base::do.call(...furrr_map_fn, args)
45. │ └─purrr (local) `<fn>`(.x = 1, .f = `<fn>`)
46. │ └─purrr:::map_("list", .x, .f, ..., .progress = .progress)
47. │ ├─purrr:::with_indexed_errors(...)
48. │ │ └─base::withCallingHandlers(...)
49. │ ├─purrr:::call_with_cleanup(...)
50. │ └─.f(.x[[i]], ...)
51. │ └─simpr (local) ...furrr_fn(...)
52. │ ├─broom::glance(lm(x2 ~ x1)) at test_calc_glance.R:11:5
53. │ └─broom:::glance.lm(lm(x2 ~ x1))
54. │ ├─base::with(...)
55. │ └─base::with.default(...)
56. │ └─base::eval(substitute(expr), data, enclos = parent.frame())
57. │ └─base::eval(substitute(expr), data, enclos = parent.frame())
58. │ └─tibble::tibble(...)
59. │ └─tibble:::tibble_quos(xs, .rows, .name_repair)
60. │ └─rlang::eval_tidy(xs[[j]], mask)
61. ├─stats::AIC(x)
62. ├─stats:::AIC.default(x)
63. └─base::.handleSimpleError(...)
64. └─purrr (local) h(simpleError(msg, call))
65. └─cli::cli_abort(...)
66. └─rlang::abort(...)
── Error ('test_include.R:67:3'): delayed tidy() and glance() same as generate() ──
<purrr_error_indexed/rlang_error/error/condition>
Error in `map(.x, .f, ...)`: ℹ In index: 1.
ℹ With name: lm.
Caused by error:
ℹ In index: 1.
ℹ With name: 1.
Caused by error in `ll()`:
! could not find function "ll"
[ FAIL 2 | WARN 1 | SKIP 0 | PASS 48 ]
Error: Test failures
Execution halted
- checking for unstated dependencies in vignettes ... OK
- checking package vignettes ... OK
- checking re-building of vignette outputs ... [38s] ERROR
Error(s) in re-building vignettes:
--- re-building 'optimization.Rmd' using rmarkdown
--- finished re-building 'optimization.Rmd'
--- re-building 'reproducibility.Rmd' using rmarkdown
--- finished re-building 'reproducibility.Rmd'
--- re-building 'simpr.Rmd' using rmarkdown
Quitting from simpr.Rmd:340-348 [glance_fits_simple]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NULL
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: processing vignette 'simpr.Rmd' failed with diagnostics:
ℹ In index: 1.
ℹ With name: lm.
Caused by error:
ℹ In index: 1.
ℹ With name: 1.
Caused by error in `ll()`:
! could not find function "ll"
--- failed re-building 'simpr.Rmd'
--- re-building 'simulation-errors.Rmd' using rmarkdown
--- finished re-building 'simulation-errors.Rmd'
SUMMARY: processing the following file failed:
'simpr.Rmd'
Error: Vignette re-building failed.
Execution halted
- checking PDF version of manual ... [29s] OK
- checking HTML version of manual ... [4s] OK
- DONE
Status: 3 ERRORs