[R-pkg-devel] Check errors for RMarkdown vignettes with error chunks

Ivan Krylov |kry|ov @end|ng |rom d|@root@org
Fri Jun 7 15:50:59 CEST 2024


В Fri, 7 Jun 2024 09:10:03 +0200
"C.H." <chainsawtiney using gmail.com> пишет:

> RMarkdown vignettes are sometimes used to demonstrate errors and one
> can write vignettes with `error` chunks.
> 
> ```{r, error = TRUE}
> stop()
> ```

> But now CRAN also reports the same ERRORS for mac and linux `oldrel`
> (4.3.3).
> 
> https://cran.r-project.org/web/checks/check_results_rio.html

It sounds like R Markdown, when tangling a vignette into an *.R file,
should provide additional wrapping for chunks with the error = TRUE
option set. Would a try({ chunk content }) suffice?

R CMD check relies on the tangled script not to crash, and there is
currently no such wrapping in the generated output:
https://github.com/cran/rio/blob/master/inst/doc/remap.R

-- 
Best regards,
Ivan



More information about the R-package-devel mailing list