[Rd] RFC: What should ?foo do?

Robert Gentleman rgentlem at fhcrc.org
Fri Apr 25 16:16:13 CEST 2008

Duncan Murdoch wrote:
> Currently ?foo does help("foo"), which looks for a man page with alias 
> foo.  If foo happens to be a function call, it will do a bit more, so
> ?mean(something)
> will find the mean method for something if mean happens to be an S4 
> generic.  There are also the type?foo variations, e.g. methods?foo, or 
> package?foo.
> I think these are all too limited.
> The easiest search should be the most permissive.  Users should need to 
> do extra work to limit their search to man pages, with exact matches, as 
> ? does.

   While I like the idea, I don't really agree with the sentiment above. 
I think that the easiest search should be the one that you want the 
result of most often.
And at least for me that is the man page for the function, so I can 
check some detail; and it works pretty well.  I use site searches much 
less frequently and would be happy to type more for them.

> We don't currently have a general purpose search for "foo", or something 
> like it.  We come close with RSiteSearch, and so possibly ?foo should 
> mean RSiteSearch("foo"), but
> there are problems with that: it can't limit itself to the current 
> version of R, and it doesn't work when you're offline (or when 
> search.r-project.org is down.)  We also have help.search("foo"), but it 
> is too limited. I'd like to have a local search that looks through the 
> man pages, manuals, FAQs, vignettes, DESCRIPTION files, etc., specific 
> to the current R installation, and I think ? should be attached to that 
> search.

  I think that would be very useful (although there will be some 
decisions on which tool to use to achieve this). But, it will also be 
problematic, as one will get tons of hits for some things, and then 
selecting the one you really want will be a pain.

  I would rather see that be one of the dyadic forms, say



  one could even imagine refining that for different subsets of the docs 
you have mentioned;

   help?foo #only man pages
   guides?foo #the manuals, R Extensions etc

and so on.

   You did not, make a suggestion as to how we would get the equivalent 
of ?foo now, if a decision to move were taken.

> Comments, please.
> Duncan Murdoch
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

Robert Gentleman, PhD
Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M2-B876
PO Box 19024
Seattle, Washington 98109-1024
rgentlem at fhcrc.org

More information about the R-devel mailing list