[Rd] R CMD check for the R code from vignettes

Yihui Xie xie at yihui.name
Tue Jun 3 07:04:08 CEST 2014


As I pointed out, \Sexpr{} is not the only potential problem. Besides,
side effects are not necessarily evil in all cases.

Since I have been described as "nitpicky", it is time for me to quit
the discussion now (adjectives on personal pronouns instead of nouns
in a discussion is a sign for me to quit in my eyes). I'm fine with
optional tangling, and I believe one should not expect to reproduce
results generated by weave using a different approach, namely
tangle+source. Some people believe tangling should mandatory, and
tangle must completely match weave in terms of code evaluation. I'm
fine with that, too. I'll be happy to see improvement in tangle
functions, as well as education on good/bad side effects. I have no
intention to win the Nobel Peace Prize, so I'm not going to make
everyone agree with each other. You hold your opinions, and I hold
mine. Once again, thanks everyone for your perspectives!

Regards,
Yihui
--
Yihui Xie <xieyihui at gmail.com>
Web: http://yihui.name


On Mon, Jun 2, 2014 at 9:18 PM, Kevin Coombes <kevin.r.coombes at gmail.com> wrote:
> "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



More information about the R-devel mailing list