From rich.fitzjohn at gmail.com  Tue Nov  7 22:42:47 2006
From: rich.fitzjohn at gmail.com (Rich FitzJohn)
Date: Wed, 8 Nov 2006 10:42:47 +1300
Subject: [Rd] How to link to vignette from .Rd file
In-Reply-To: <4550F40F.802@DecisionSynergy.com>
References: <45508F5A.7070303@agner.org> <4550944E.5010206@stats.uwo.ca>
	<4550C560.30405@DecisionSynergy.com>
	<20061107175909.GA28706@eddelbuettel.com>
	<4550F40F.802@DecisionSynergy.com>
Message-ID: <5934ae570611071342u3a80b8efg7a146f4f7df125e4@mail.gmail.com>

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

vignette("grid")

Cheers,
Rich

On 11/8/06, Dominick Samperi <dsamperi at 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 at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>


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



[Rd] How to link to vignette from .Rd file
Rich FitzJohn