Vignette Workflow

Apologies if this is a really simple issue...

In their R Packages, Hadley Wickham and Jennifer Bryan offer this very brief workflow for package vignettes:

  1. Create vignette with usethis::use_vignette("my-vignette").
  2. Modify vignette.
  3. Knit vignette to preview output.

However, the vignette includes a call to the package under development, which hasn't been installed, so when I click Knit, it throws an error saying "there is no package called ..."

So, am I supposed to build/install the package first? Or, instead of knitting, should I maybe be using devtools::build_vignettes instead?

Try this: Run devtools::build(), which will give you a path that will end in gz. Copy that path and then run install.packages(pkgs="<paste the path here>", repos=NULL). If you then try to knit it should work.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.