Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reference package vignettes with Roxygen2

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?

like image 467
StevieP Avatar asked Mar 26 '14 00:03

StevieP


People also ask

What is roxygen2?

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")

What is .RD file in R?

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.

How create Rd file in R?

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.


1 Answers

I just tell people to run the code that opens the vignette:

#' For more details see the help vignette:
#' \code{vignette("help", package = "mypkg")}
like image 113
hadley Avatar answered Oct 18 '22 19:10

hadley