I'm working on an electronic book using the bookdown package. I'm about 31 chapters in and have had very few problems up to this point. One of my chapter Rmd files includes the following code chunks:
library(dplyr)
set.seed(123)
df <- tibble(
x = rnorm(10),
y = rnorm(10),
z = rnorm(10)
) %>%
print()
df %>%
summarise(
across(
.cols = everything(),
.fns = mean,
.names = "{col}_mean"
)
)
When I run the code chunks interactively, they produce the expected results without a problem. However, when I click the "Build Book" button, I get the following error:
Quitting from lines 10530-10538 (Book.Rmd)
Error: Problem with `summarise()` input `..1`.
x Problem with `across()` input `.fns`.
ℹ Input `.fns` must be NULL, a function, a formula, or a list of functions/formulas.
ℹ Input `..1` is `across(.cols = everything(), .fns = mean, .names = "{col}_mean")`.
Backtrace:
█
1. ├─rmarkdown::render_site(output_format = "bookdown::gitbook", encoding = "UTF-8")
2. │ └─generator$render(...)
3. │ ├─xfun::in_dir(...)
4. │ └─bookdown:::render_book_script(output_format, envir, quiet)
5. │ └─bookdown::render_book(...)
6. │ └─bookdown:::render_cur_session(...)
7. │ └─rmarkdown::render(...)
8. │ └─knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet)
9. │ └─knitr:::process_file(text, output)
10. │ ├─base::withCallingHandlers(...)
11. │ ├─knitr:::process_group(group)
12. │ └─knitr:::process_group.block(gr
Execution halted
Exited with status 1.
Here's my session info:
R version 4.0.2 (2020-06-22)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.6
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] Rcpp_1.0.4.6 bookdown_0.20 tidyr_1.1.0 crayon_1.3.4
[5] digest_0.6.25 dplyr_1.0.1 R6_2.4.1 lifecycle_0.2.0
[9] magrittr_1.5 evaluate_0.14 pillar_1.4.4 rlang_0.4.7
[13] rstudioapi_0.11 ellipsis_0.3.1 vctrs_0.3.2 generics_0.0.2
[17] rmarkdown_2.1 tools_4.0.2 glue_1.4.1 purrr_0.3.4
[21] xfun_0.13 yaml_2.2.1 compiler_4.0.2 pkgconfig_2.0.3
[25] htmltools_0.4.0 tidyselect_1.1.0 knitr_1.28 tibble_3.0.1
Does anybody know what this is about?