Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languager
#create the folder structure
usethis::use_vignette("my-vignette")

This is an example of a R package that shows the vignettes folder has been created.

...

In the vignette folder you should find a file named my-vignetted.Rmd. You can then add some content to the file.

...

R Notebooks and Vignettes: How do I execute the code?

You could either click on the green a arrows next to each code chunks; i.e., the gray areas. Or

You can use the menu Run. You can see all the code can the executed in one go (Run All option). You can also run each code chunk on its own.

Save a R Notebook to HTML

Once you have run all the code chunks, you can save the R Notebook. An html file will be created.

Save a Vignette

To save a vignette in the desired format, you need to click on the knit button. The knit to html_vignette will create a html file. It is save in the location stated under the Knit Directory.

...

This is the vignette created by Knit.

...