Reference package vignettes with Roxygen2
Asked Answered
O

2

20

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?

Oriya answered 26/3, 2014 at 0:26 Comment(0)
A
17

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

#' For more details see the help vignette:
#' \code{vignette("help", package = "mypkg")}
Araiza answered 26/3, 2014 at 12:53 Comment(0)
F
14

I know this is 4 years old...and hadley provided the answer...but I'd like to offer another option:

\href{../doc/help.html}{\code{vignette("help", package = "mypkg")}}

This gives a direct link to opening the vignette, and provides the code to show the user how to open it on their own.

Futhark answered 12/7, 2018 at 14:20 Comment(1)
I'd take back this recommendation if you are using pkgdown. pkgdown will turn the \code{vignette("help", package = "mypkg")} directly to a url to the vignette article (ie..using what was recommended above)Futhark

© 2022 - 2024 — McMap. All rights reserved.