[R-pkg-devel] [CRAN-pretest-archived] CRAN submission gwsem 2.0.3

Duncan Murdoch murdoch@dunc@n @end|ng |rom gm@||@com
Sun Jun 14 17:28:17 CEST 2020


On 14/06/2020 10:59 a.m., Joshua N Pritikin wrote:
> On Sun, Jun 14, 2020 at 09:17:32AM -0400, Duncan Murdoch wrote:
>> Since you're using Rmarkdown, you can use a variable for the eval
>> chunk option, e.g. put this in your setup chunk:
>>
>> knitr::opts_chunk$set(eval = !is_CRAN)
> 
> This works except for in-text `r 1+1` code fragments. Is there an option
> to make these evaluate to "[MISSING]" or similar?

To suppress evaluation of those, you can use this:

knitr::knit_hooks$set(evaluate.inline = function(x, envir) x)

This will show the code in place of evaluating it and showing its value.
Replace the function value with "[MISSING]" if you don't want to see the 
code.

Duncan



More information about the R-package-devel mailing list