Re: [R-pkg-devel] Interpret feedback: not write testthat-tests in examples

2020-07-17 Thread Maëlle SALMON via R-package-devel
If you do want to communicate around tests a bit more, without cluttering the manual, you might find the covrpage package interesting  https://yonicd.github.io/covrpage/ It creates a README in the tests folder, with test results, and it can create a vignette with the same content. On dj., ju

Re: [R-pkg-devel] Interpret feedback: not write testthat-tests in examples

2020-07-16 Thread Jeff Newmiller
The point of an example is to provide an illustration of how the function should be used for people who are not software developers. IMO any use of any other functions should be absolutely minimized to reduce the cognitive overload ("you need to understand 13 other concepts before you can unders

Re: [R-pkg-devel] Interpret feedback: not write testthat-tests in examples

2020-07-16 Thread Henrik Bengtsson
If the point of having, say, stopifnot(add(1, 2) == sum(c(1, 2)) is to make it explicit to the reader that your add() function gives the same results as sum(), then I argue that is valid to use in an example. I'm pretty sure I've used that in some of my examples. For the purpose, there should b

Re: [R-pkg-devel] Interpret feedback: not write testthat-tests in examples

2020-07-16 Thread Mark van der Loo
Dear Richel, The comment itself is pretty clear I think: to be accepted on CRAN you should not use testthat tests in your examples. I can't speak for CRAN but I'm pretty convinced this is for testing in general. Tests are for testing, not for demonstration. Most users of your package will probab

Re: [R-pkg-devel] Interpret feedback: not write testthat-tests in examples

2020-07-16 Thread Robert M. Flight
Richel, I think that feedback is important. Examples are examples first, and tests second, as in if your examples no longer work, then maybe you need to check your underlying code. {testthat} tests belong in their own `tests` directory, and are used to directly test your code and provide feedback