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

From: Dominick Samperi <dsamperi_at_decisionsynergy.com>
Date: Tue 07 Nov 2006 - 17:41:52 GMT

Duncan Murdoch wrote:
> On 11/7/2006 8:51 AM, Agner Fog wrote:
>
>> I am building a package for various noncentral hypergeometric distributions.
>>
>> I want to include some heavy mathematical formulas. It appears that the
>> build and INSTALL commands produce only .chm files and not .pdf files
>> from my .Rd files under Windows. This means that it cannot show
>> complicated mathematical formulas.
>>
>> The solution might be to include a .pdf file as a vignette. I tried
>> that, but I can't find any way to link to the .pdf file or access it
>> from any of the help facilities. The .pdf file is useless if the user
>> can't find it.
>>
>
> Yes, that's a major problem in the current R help system. You can give
> the user code that would work to show the vignette, but there's no way
> to create a live link to it.
>
The demo system can be used to compensate for limitations of the help system.
You can display PDF files from any package subdirectory using a demo file like this (named demo/ReadPkgDoc.R, and documented in demo/00Index):

# ReadPkgDoc.R -- Displays a PDF file as a demo #
isWindows <- (Sys.info()['sysname'] == 'Windows') file <- system.file("doc", "PkgManual.pdf", package="PkgName") 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("xpdf ", file, "\n"))
}

To create the PDF file from the Rd file use R CMD Rd2dvi, and dvipdf.

ds



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Wed Nov 08 04:46:48 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 - 18:30:37 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.