-----Original Message-----
From: Hadley Wickham [mailto:h.wickham at gmail.com]
Sent: Monday, November 19, 2018 6:21 PM
To: Fox, John <jfox at mcmaster.ca>
Cc: R Package Development <r-package-devel at r-project.org>
Subject: Re: [R-pkg-devel] creating a link to a vignette in a .Rd file
On Mon, Nov 19, 2018 at 4:49 PM Fox, John <jfox at mcmaster.ca> wrote:
Dear r-package-devel list members,
I'd like to create a link to a package vignette from a help file in the same
package, for example to the "partial-residuals" vignette in the effects package
from effect.Rd. I'm able to generate a URL for the vignette as follows:
\Sexpr[results=text]{paste0("file://", system.file("doc",
"partial-residuals.pdf", package="effects"))}
but I'm unable to link to the resulting text string using href{}{} or url{}
because \Sexpr[etc]{etc.} is treated as verbatim text rather than evaluated.
Is there a way around this problem or another approach that works?
Have you confirmed that a raw file:// url works? I would be mildly surprised if
it did, given my understanding of how web browser security works (which is
patchy, but you should still check before going too far down this path).
Don't you just need `results=rd` ?
\Sexpr[results=rd]{paste0("\\url{file://", system.file("doc", "partial-
residuals.pdf", package="effects"), "}")}
Hadley
--
http://hadley.nz