简体   繁体   中英

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 ? Eg I'd like to reference /inst/doc/mypdf.pdf inside the roxygen2 comments for myFunc . What would that look like? Is it even possible?

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

#' For more details see the help vignette:
#' \code{vignette("help", package = "mypkg")}

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM