So, I'd like to reference one of my package vignettes inside the roxygen2 comments of a function but I'm having a hard time understanding how to do it.
More generally, how do we reference documents inside /inst/doc
? E.g. I'd like to reference /inst/doc/mypdf.pdf
inside the roxygen2 comments for myFunc
. What would that look like? Is it even possible?
roxygen2 allows you to write specially formatted R comments that generate R documentation files ( man/*. Rd ) and a NAMESPACE file. roxygen2 is used by over 8,000 CRAN packages. Install the latest version of roxygen2 with: install.packages("roxygen2")
R objects are documented in files written in “R documentation” (Rd) format, a simple markup language much of which closely resembles (La)TeX, which can be processed into a variety of formats, including LaTeX, HTML and plain text.
Creating Rd FilesUse the File -> New -> R Documentation command in RStudio. This command will allow you to specify the name of an existing function or dataset to use as the basis for the Rd file or alternatively will create a new empty Rd file.
I just tell people to run the code that opens the vignette:
#' For more details see the help vignette:
#' \code{vignette("help", package = "mypkg")}
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