carpentries-incubator / lesson-R-packaging

R Packaging
https://carpentries-incubator.github.io/lesson-R-packaging/
Other
5 stars 10 forks source link

workflow for vignettes #96

Closed f-hafner closed 1 year ago

f-hafner commented 1 year ago

Not sure how relevant this is in practice, but how much detail do you want to cover the workflow for making vignettes? (what is the experience from previous workshops)? This is related to the discussion on reloading the package in https://github.com/carpentries-incubator/lesson-R-packaging/pull/92, and if the conclusion there is to use install(), then this issue can be closed.

I have been trying to incorporate some of the suggestions for writing vignettes from the book. I understand them as follows:

  1. write vignette, discover that you want to change myfunction in package.
  2. change myfunction.
  3. run devtools::load_all() in the console (and not in an Rmd chunk)
  4. update the vignette Rmd
  5. iterate until happy
  6. make a "disposable preview" of the html with either the knit button, or devtools::build_rmd("vignettes/my-vignette.Rmd"). I think the difference is that devtools::build_rmd() automatically considers the changes in the package made, while using the knit button will use the currently installed local version of the package. and if we used load_all() in step 2 above, the resulting html file will not reflect these changes.

So, in short, if we recommend using load_all() for development in previous episodes, we may have to discuss the above in the episode on vignettes.

bvreede commented 1 year ago

I addressed this with #113 — forgot to tag the issue though! Sorry :)