[R-pkg-devel] Where do demos fit in?

Peter Carbonetto peter.carbonetto at gmail.com
Fri Oct 20 22:11:43 CEST 2017


Hi Neal,

Re-using demos for your package tests is a great idea, and should be done
more often.

However, I tend to agree with Iñaki---I generally prefer vignettes to demos.

I wanted to point out that you could take a similar strategy to what you
suggested, but using a vignette instead of a demo. The code is slightly
more complicated but seems to work. See here for an example:

https://raw.githubusercontent.com/pcarbo/varbvs/test_vignette/varbvs-R/tests/testthat/test_vignette.R

(Anyone, please reply if you know of a better way to implement this!)

Peter

On Fri, Oct 20, 2017 at 1:18 AM, Iñaki Úcar <i.ucar86 at gmail.com> wrote:

> 2017-10-20 5:42 GMT+02:00 Neal Fultz <nfultz at gmail.com>:
> > A graduate student just asked me (copied below), in response to a bug I
> > wrote (
> > https://github.com/DeclareDesign/estimatr/pull/38/commits/
> 99e82e253979d1307714632e9dc05d2e2c9c66df
> > ):
> >
> > How do demos normally relate to tests and vignettes? Is the purpose
> simply
> >> to have manually run tests that check the things work in the global
> >> environment?
>
> There is a good definition and description here:
> http://r-pkgs.had.co.nz/misc.html
>
> Personally, I'm not a fan of demos, because I prefer to copy&paste
> from vignettes as I read and understand the different parts of the
> problem in question.
>
> Iñaki
>
> ______________________________________________
> R-package-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list