[R-pkg-devel] Run-times of examples in vignettes
My solution is similar to Ben's solution. Except that the code for creating the data is in the vignette. The chunk only runs when the data is not available. The trick is to pass code to the eval argument instead of a fixed TRUE or FALSE. See https://github.com/ropensci/git2rdata/blob/bad8a4cf42049faa72a04b202c5a4dfc233b4046/vignettes/efficiency.Rmd#L293 for an example. ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND FOREST Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance thierry.onkelinx at inbo.be Havenlaan 88 bus 73, 1000 Brussel www.inbo.be /////////////////////////////////////////////////////////////////////////////////////////// To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher The plural of anecdote is not data. ~ Roger Brinner The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey /////////////////////////////////////////////////////////////////////////////////////////// <https://www.inbo.be> Op di 27 okt. 2020 om 16:29 schreef Ben Bolker <bbolker at gmail.com>:
My general solution is to run time-consuming computations in advance
and store the results in (e.g.) inst/vignette_data, whence they can be
retrieved via system.file("vignette_data", "output.rda",
package="my_pkg"). (I might also include the R script required to
generate the file so that I could automatically re-make those outputs as
required ...)
On 10/27/20 8:53 AM, Helmut Sch?tz wrote:
Hi Dirk, Dirk Eddelbuettel wrote on 2020-10-27 13:32:
| is there somewhere an official statement about the maximum run-times
of
| examples in vignettes? Seven minutes is excessive.
Sure. The one vignette contains simulation code which needs 1E5 to 1E6 sims to get a stable result. Fewer sims are simply not meaningful. Since we use a pre-complied vignette now the execution time is essentially zero. The others take 45 seconds in total. If we would pre-compile the second slowest as well, we would be down for the remaining four at 12 seconds.
I have (long) gone by the rule of "about one minute" each for tests and examples.
OK. Do you know of any reference for this "rule"? Helmut
______________________________________________ R-package-devel at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel