Versions Compared

Key

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

...

Code Block
languager
# install the package R Markdown and knitr
install.packages("rmarkdown")
install.packages("knitr")

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

Additional reading list

...

Additional reading list

Using Vignettes

Vignettes are created within a R package.

Create an R package

  1. Create a new project (File menu, New project option)

  2. Create a new project in a new directory

  3. Select R package.

  4. Follow the instructions of the following steps.

Create vignettes folder

If you type this instruction (i.e., line 2) within a R package . You should see the following messages.

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

Image Added

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; the gray areas. Or 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.

Image Added