Re: [Rd] How to link to vignette from .Rd file

From: Rich FitzJohn <rich.fitzjohn_at_gmail.com>
Date: Tue 07 Nov 2006 - 21:42:47 GMT

This all seems very similar to the built-in "vignette" function; e.g.

vignette("grid")

Cheers,
Rich

On 11/8/06, Dominick Samperi <dsamperi@decisionsynergy.com> wrote:
> Dirk Eddelbuettel wrote:
> > There is options("pdfviewer") -- at least under Unix. Maybe there is
> > even an R call to use it on a file, employed by the help system?
> > Dirk
> Thanks,
> Here is a more complete solution that can be turned into a general-purpose
> function...
>
> # Displays PDF file as an R demo
> #
> pkgName <- 'MyPackage'
> pkgDir <- 'doc'
> pdfFile <- 'MyPackageDoc.pdf'
> isWindows <- (Sys.info()['sysname'] == 'Windows')
> pkgLoc <- system.file(".", ".", package=pkgName)
> pkgLoc <- substring(pkgLoc, 1, nchar(pkgLoc)-nchar(pkgName)-5)
> file <- system.file(pkgDir, pdfFile, package=pkgName,lib.loc=pkgLoc)
> if(isWindows) { # Windows automatically finds executable based on file type.
> system(paste("CMD /C ", file, "\n"))
> } else { # Change this to use path to Adobe reader if desired.
> system(paste(options("pdfviewer"), file, "\n"))
> }
>
> ______________________________________________
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

-- 
Rich FitzJohn
rich.fitzjohn <at> gmail.com

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Wed Nov 08 08:46:39 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 08 Nov 2006 - 01:30:38 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.