Hi I tried to customize help(), so it starts the compiled html help, and searches in all packages. I wrote the following function: > my.help function(topic){ help(topic, package=.packages(all=T), lib.loc=.lib.loc, chmhelp=T) } When I use it with>my.help(help)give the following error: Error in help(topic, package = .packages(all = T), lib.loc = .lib.loc, : No documentation for `topic' I tried also with> my.helpfunction(x){ help(x,chmhelp)} with the same result. Only doing help(help) is working. Why my function doesn't work? ` Kurt Gerber ******************************************** Kurt Gerber Center for Developement and Environment Institute of Geography University Bern Hallerstrasse 12 3012 Bern phone: +41(0)31 631 40 02 fax: +41(0)31 631 85 44 e-mail: kgerber at giub.unibe.ch www: http://www.cde.unibe.ch ******************************************** -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Tue, 4 Apr 2000, Kurt Gerber wrote:> Hi > I tried to customize help(), so it starts the compiled html help, and > searches in all packages. > > I wrote the following function: > > > my.help > function(topic){ > help(topic, package=.packages(all=T), lib.loc=.lib.loc, chmhelp=T) > } > > When I use it with > > >my.help(help) > > give the following error: > > Error in help(topic, package = .packages(all = T), lib.loc = .lib.loc, : > No documentation for `topic' > > I tried also with > > my.help > function(x){ > help(x,chmhelp)} > > with the same result. > Only doing help(help) is working. Why my function doesn't work?Because the first argument of help() is handled specially, to allow help(help) or help("help"). my.help(help) passes the help object to help, not "help". But my.help("help") will still fail. I could tell you how to do this, but I do think it is a bad idea, and we worked quite hard to do something better in 1.0.0. The problem is that those options will find a copy of the help under a given name, and quite possibly not help for the object in the packages you have loaded. You can set the preference for chmhelp via an options setting. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>>>>> "Kurt" == Kurt Gerber <kgerber at giub.unibe.ch> writes:Kurt> Hi Kurt> I tried to customize help(), so it starts the compiled html help, and Kurt> searches in all packages. ------------------------ <.....> just an aside additional to Prof Ripley's answer: Your "searches in all packages" can be accomplished by the help.search() function which might less known than it should. Given a "topic" it lists "help files" {typically names of R objects} from ALL available packages, see ?help.search Martin Maechler <maechler at stat.math.ethz.ch> http://stat.ethz.ch/~maechler/ Seminar fuer Statistik, ETH-Zentrum LEO D10 Leonhardstr. 27 ETH (Federal Inst. Technology) 8092 Zurich SWITZERLAND phone: x-41-1-632-3408 fax: ...-1228 <>< -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._