Hi, I am working on a package which requires separate documentation (tutorial documentation, really, with a lot of beautifully latexed equations), and does not use R-help. I am trying to make it so that my help function will automatically search R-help if the help topic isn't found in my documentation. The function looks something like this: help.pkg <- function(topic) { # where the topic is a character string url <- NULL if(is.character(topic)) { ..... # assignments for the URL given the topic } if (is.null(url)) { topic <- as.name(topic) help(topic) } } In the last line, help(topic) returns that there is no help for "topic". I have also tried various permutations of substitute(help(topic)) and eval() to no avail. Any suggestions are greatly appreciated. Thanks, Olivia Lau.
Olivia Lau wrote:> Hi, > > I am working on a package which requires separate documentation > (tutorial documentation, really, with a lot of beautifully > latexed equations), and does not use R-help. I am trying to > make it so that my help function will automatically search > R-help if the help topic isn't found in my documentation. > > The function looks something like this: > > help.pkg <- function(topic) { # where the topic is a > character string > url <- NULL > if(is.character(topic)) { > ..... # assignments for the URL given the topic > } > if (is.null(url)) { > topic <- as.name(topic) > help(topic) > } > } > > In the last line, help(topic) returns that there is no help for > "topic". I have also tried various permutations of > substitute(help(topic)) and eval() to no avail.do.call("help", list(topic)) Uwe Ligges> Any suggestions are greatly appreciated. Thanks, > > Olivia Lau. > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Martin Maechler
2003-Sep-25 14:11 UTC
[R] Tutorial docs: Vignettes! {was "searching R-help .."}
>>>>> "Olivia" == Olivia Lau <olau at fas.harvard.edu> >>>>> on Mon, 22 Sep 2003 20:51:18 -0400 writes:Olivia> Hi, Olivia> I am working on a package which requires separate documentation Olivia> (tutorial documentation, really, with a lot of beautifully Olivia> latexed equations), and does not use R-help. Ooh, that's a pity. Many packages nowadays (the first ones were the Bioconductor packages AFAIK) have tutorial documentation along with them, you put it into ./inst/doc/ which will be installed into ./doc/ for the installed package. Ideally, that's what **vignette**s are for, You can have beautiful Latex + (R code + R output + R graphics) all in your vignette, the "+ ..." part, if you make use of Sweave. If you do that, library(help = <package>) will end like Devore6> Further information is available in the following vignettes in Devore6> directory '/sfs/s/linux/7.3/app/R/R_local/library/Devore6/doc': Devore6> Devore6> Devore6: Using the Devore6 package (source, pdf) Devore6> Intro: Introduction to the Devore6 package for R (source, pdf) In my installed CRAN packages, I see the following having Sweave based vignettes: bim Devore6 exactLoglinTest hwde ipred lmtest maxstat multcomp mvtnorm SparseM spdep strucchange I'd recommend taking one of these (or the Bioconductor ones if you are using some of them!) as an example to follow. And many more packages have other *.pdf documents in their installed ./doc/ directories. However, currently this is not shown in library(help = <package>) --- nor anywhere on CRAN's package-source page (which may be worth improving ...) Olivia> .................. Olivia> .................. Martin Maechler <maechler at stat.math.ethz.ch> http://stat.ethz.ch/~maechler/ Seminar fuer Statistik, ETH-Zentrum LEO C16 Leonhardstr. 27 ETH (Federal Inst. Technology) 8092 Zurich SWITZERLAND phone: x-41-1-632-3408 fax: ...-1228 <><
Dear Martin At 04:11 PM 9/25/2003 +0200, Martin Maechler wrote: . . .>And many more packages have other *.pdf documents in their installed >./doc/ directories. However, currently this is not shown >in library(help = <package>) >--- nor anywhere on CRAN's package-source page (which may be >worth improving ...)I'll second this motion -- to provide convenient access to whatever pdf file are in a packages's doc directory. Regards, John ----------------------------------------------------- John Fox Department of Sociology McMaster University Hamilton, Ontario, Canada L8S 4M4 email: jfox at mcmaster.ca phone: 905-525-9140x23604 web: www.socsci.mcmaster.ca/jfox
Martin Maechler wrote:> If you do that, library(help = <package>) > >will end like >Devore6> Further information is available in the following vignettes in > >... >This does not seem to work completely correctly (checked only on Linux) if there is more than one pdf file in inst/doc. The pdf files all get installed in the package doc directory, but library(help = <package>) ignores some of them. In my case, in dse1/doc there are files dse-guide.pdf, dse1-guide.pdf, and dse1-guide-012.pdf. The last should probably be ignored as it is generated by the sweave process and pulled into dse1-guide.pdf. The first is the most important one, but is ignored. It is the guide for the whole bundle which I build from vignettes for the packages, so it includes the second. This problem is related to the fact that there is no good place to put documentation for a bundle (or other group) of packages. Paul Gilbert