Hello, I have a package which includes some parameterized r-markdown report which I would also like to build as package vignettes. Is there a way to run the parameterized vignette creation with the package build or package check? Thank you -- Witold Eryk Wolski
Witold, Vignettes, in the package sense, are and must be entirely self-contained as far as I know. They are run automatically in completely clean R sessions. I'm not sure a parameterized vignette makes a ton of sense within that context. Can you explain what you would want to have happen when the package is built that would require parameterization? ~G On Mon, Jul 2, 2018 at 7:30 AM, Witold E Wolski <wewolski at gmail.com> wrote:> Hello, > > I have a package which includes some parameterized r-markdown report > which I would also like to build as package vignettes. > > Is there a way to run the parameterized vignette creation with the > package build or package check? > > Thank you > > -- > Witold Eryk Wolski > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > >-- Gabriel Becker, Ph.D Scientist Bioinformatics and Computational Biology Genentech Research [[alternative HTML version deleted]]
On 02/07/2018 10:30 AM, Witold E Wolski wrote:> Hello, > > I have a package which includes some parameterized r-markdown report > which I would also like to build as package vignettes. > > Is there a way to run the parameterized vignette creation with the > package build or package check?Doesn't the usual method work? You can specify defaults for parameters in the YAML header; I'd expect those to be the parameter values that get used. You can give instructions to your users on how to rebuild the reports with different parameters. Duncan Murdoch> > Thank you >
On 02/07/2018 10:34 AM, Gabe Becker wrote:> Witold, > > Vignettes, in the package sense, are and must be entirely self-contained as > far as I know. They are run automatically in completely clean R sessions. > I'm not sure a parameterized vignette makes a ton of sense within that > context.The defaults for parameters are contained in the source, so a vignette using default parameter values would be completely self-contained. It seems like a good way to document parameterized reports: Include one as a vignette that has more explanation about what the parameters mean, how they are used, etc. Then users can try it out with new parameter values before customizing it to their own needs. Duncan Murdoch> > Can you explain what you would want to have happen when the package is > built that would require parameterization? > > ~G > > On Mon, Jul 2, 2018 at 7:30 AM, Witold E Wolski <wewolski at gmail.com> wrote: > >> Hello, >> >> I have a package which includes some parameterized r-markdown report >> which I would also like to build as package vignettes. >> >> Is there a way to run the parameterized vignette creation with the >> package build or package check? >> >> Thank you >> >> -- >> Witold Eryk Wolski >> >> ______________________________________________ >> R-devel at r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-devel >> >> > >
Hello, Thank you for the questions as well as remaining me of the default parameters in the yaml session. Indeed this seems to be the solution. But how would I assign package data as a default parameter? So originally I thought to render the markdown with : <code> data(sample_analysis) data(skylineconfig) x <- rmarkdown::render("report.Rmd", output_format = "html_document", params = list(data = sample_analysis, configuration skylineconfig),envir = new.env()) <code> I do not think I can write: params: configuration: !r data(sample_analysis) data: !r data(skylineconfig) since data does not return the package just puts them in the env as a side effect. Is there a different base function to achieve it. Thank you Witek On 2 July 2018 at 16:56, Duncan Murdoch <murdoch.duncan at gmail.com> wrote:> On 02/07/2018 10:30 AM, Witold E Wolski wrote: >> >> Hello, >> >> I have a package which includes some parameterized r-markdown report >> which I would also like to build as package vignettes. >> >> Is there a way to run the parameterized vignette creation with the >> package build or package check? > > > > Doesn't the usual method work? You can specify defaults for parameters in > the YAML header; I'd expect those to be the parameter values that get used. > > You can give instructions to your users on how to rebuild the reports with > different parameters. > > Duncan Murdoch > >> >> Thank you >> >-- Witold Eryk Wolski