Skip to content
Prev 48396 / 63424 Next

R CMD check for the R code from vignettes

"Doc, it hurts when I do this."
"So, don't do that."

If no one in R Core does anything about this issue (in terms of changing 
Sweave or Stangle), then the solution still remains very simple.  
Authors of vignettes should avoid using anything in \Sexpr{} that has a 
side effect. As long as they do that, the code will tangle correctly and 
produce the same result as Sweave.

R CMD check already detects other things which may or may not be 
outright errors but are viewed as bad practice. I think it is bad 
practice to put code with side effects into an Sexpr. So, I don't do 
that. If I did do that accidentally, I really wouldn't mind if R CMD 
check warned me abut it.

   -- Kevin
On 6/2/2014 6:28 PM, Gavin Simpson wrote: