I have a small R package that I use to distribute data sets for a class that I teach. I recently started updating materials for the upcoming semester but when I try to knit .rmd files using the knit button in RStudio, I get the following error:
Error in if (grepl("(html|gitbook|bs4)", format)) return("html") :
argument is of length zero
Calls: <Anonymous> ... <Anonymous> -> <Anonymous> -> render_book -> target_format
Execution halted
This occurs for any .rmd file (vignettes that have worked fine in the past, xaringan slides, default .rmd template). Using rmarkdown::render() seems to work fine, so I can simply use that, though would prefer the knit button to work if possible. Google has not provided any hints so any tips on figuring out what is causing the error would be appreciated. R session info below.
R version 4.2.0 (2022-04-22)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.7
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.2/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.9 compiler_4.2.0 pillar_1.8.0 class_7.3-20
[5] tools_4.2.0 digest_0.6.29 evaluate_0.15 lifecycle_1.0.1
[9] tibble_3.1.8 pkgconfig_2.0.3 rlang_1.0.4 DBI_1.1.3
[13] cli_3.3.0 rstudioapi_0.13 yaml_2.3.5 xfun_0.31
[17] fastmap_1.1.0 e1071_1.7-11 dplyr_1.0.9 knitr_1.39
[21] generics_0.1.3 vctrs_0.4.1 classInt_0.4-7 grid_4.2.0
[25] tidyselect_1.1.2 glue_1.6.2 sf_1.0-7 R6_2.5.1
[29] fansi_1.0.3 bookdown_0.27 xaringan_0.25 rmarkdown_2.14
[33] purrr_0.3.4 tidyr_1.2.0 magrittr_2.0.3 backports_1.4.1
[37] htmltools_0.5.2 units_0.8-0 assertthat_0.2.1 KernSmooth_2.23-20
[41] utf8_1.2.2 proxy_0.4-27 broom_0.8.0