Is there any way I can include links between package vignettes in R? I know I can link between section, for example
# Section 1 {#section1} My first section # Section 2 A link to [Section 1](#section1)
But is there any way I can get a clickable link that will launch the HTML doucment of another vignette? Or is it just easier to give the code to launch it?
```r vignette("my vignette", package = "myPackage") ```
Note I have generated all of my vignettes using Rmarkdown
and knitr
.
To create a package vignette in R Markdown, the easiest way is through the RStudio menu File -> New File -> R Markdown -> From Template (see Figure 16.4). Then you select “Package Vignette” from the rmarkdown package, and you will get a vignette template.
A vignette is like a book chapter or an academic paper: it can describe the problem that your package is designed to solve, and then show the reader how to solve it. Many existing packages have vignettes.
You can discover vignettes by accessing the help page for a package, or via the browseVignettes() function: the command browseVignettes() opens a list of vignettes from all of your installed packages in your browser, while browseVignettes(package=package-name) (e.g., browseVignettes(package="survival") ) shows the ...
The R package knitr is a general-purpose literate programming engine, with lightweight API's designed to give users full control of the output without heavy coding work. It combines many features into one package with slight tweaks motivated from my everyday use of Sweave.
Yes, this is simple. Vignettes are all stored in the same directory, so you simply refer to the appropriate file name. The drat package vignettes have several examples of this. Here is a link from one vignette to the other:
This vignette deals with the first case: How to use [drat](http://dirk.eddelbuettel.com/code/drat.html) as a package author. A [companion vignette for package users](DratForPackageUsers.html) is available as well.
This will work on CRAN and on a user's machine.
You should also be able to link from vignettes to documentation, and vice versa, on a user's machine, knowing that vignettes are stored in library/PKGNAME/doc/
and documentation is stored in: library/PKGNAME/html/
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With