...
Code Block | ||
---|---|---|
| ||
# 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
Create a new project (File menu, New project option)
Create a new project in a new directory
Select R package.
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 | ||
---|---|---|
| ||
#create the folder structure
usethis::use_vignette("my-vignette") |
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.