Hi,
I want to have a way to knit a .Rmd file even if one of the chunks has an error.
I have an .Rmd that starts with this chunk. When I try to knit it it fails with
Line 7 print(x) : object 'x' not found Calls: ... withCallingHandlers -> withVisible ->
eval -> print Execution halted
---
title: "test_knit_with_error"
output: html_document
---
```{r setup}
# , include=TRUE, cache = F
knitr::opts_chunk$set(
warning = TRUE, # show warnings
message = TRUE, # show messages
include=TRUE,
error = TRUE, # do not interrupt generation in case of errors,
echo = TRUE # show R code
)
print(x)
I also tried the same with {r setup , include=TRUE, cache = F} and got same mistake.
Just in case, here is my session info
sessionInfo()
R version 4.0.2 (2020-06-22)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.2 LTS
Matrix products: default
BLAS/LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.8.so
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8
[4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_MESSAGES=C
[7] LC_PAPER=en_US.UTF-8 LC_NAME=en_US.UTF-8 LC_ADDRESS=en_US.UTF-8
[10] LC_TELEPHONE=en_US.UTF-8 LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] mailR_0.4.1
loaded via a namespace (and not attached):
[1] digest_0.6.25 R.methodsS3_1.8.1 magrittr_1.5 evaluate_0.14 stringi_1.5.3 rlang_0.4.7
[7] R.oo_1.24.0 R.utils_2.10.1 rmarkdown_2.4 tools_4.0.2 stringr_1.4.0 tinytex_0.26
[13] xfun_0.18 yaml_2.2.1 rsconnect_0.8.16 compiler_4.0.2 rJava_0.9-13 htmltools_0.5.0
[19] knitr_1.30
sessionInfo()
R version 4.0.2 (2020-06-22)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.2 LTS
Matrix products: default
BLAS/LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.8.so
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8
[4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_MESSAGES=C
[7] LC_PAPER=en_US.UTF-8 LC_NAME=en_US.UTF-8 LC_ADDRESS=en_US.UTF-8
[10] LC_TELEPHONE=en_US.UTF-8 LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] mailR_0.4.1
loaded via a namespace (and not attached):
[1] digest_0.6.25 R.methodsS3_1.8.1 magrittr_1.5 evaluate_0.14 stringi_1.5.3 rlang_0.4.7
[7] R.oo_1.24.0 R.utils_2.10.1 rmarkdown_2.4 tools_4.0.2 stringr_1.4.0 tinytex_0.26
[13] xfun_0.18 yaml_2.2.1 rsconnect_0.8.16 compiler_4.0.2 rJava_0.9-13 htmltools_0.5.0
[19] knitr_1.30