[Rd] RFC: What should ?foo do?

Robert Gentleman rgentlem at fhcrc.org
Fri Apr 25 17:55:46 CEST 2008



Duncan Murdoch wrote:
> On 4/25/2008 10:16 AM, Robert Gentleman wrote:
>>
>> 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.
> 
> That's true.
> 
> What's your feeling about what should happen when ?foo fails?

   present of list of man pages with spellings close to foo (we have the 
tools to do this in many places right now, and it would be a great help, 
IMHO, as spellings and capitalization behavior varies both between and 
within individuals), so the user can select one

> 
> 
>>
>>>
>>> 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
>>
>>    site?foo
>>
>>   or
>>    all?foo
>>
>>   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.
> 
> I didn't say, but I would assume there would be a way to do it, and it 
> shouldn't be hard to invoke.  Maybe help?foo as you suggested, or man?foo.

   If not then I would be strongly opposed -- I really think we want to 
make the most common thing the easiest to do.  And if we really think 
that might be different for different people, then disambiguate the 
"short-cut", ? in this case, from the command so that users have some 
freedom to customize, would be my favored alternative.

   I also wonder if one could not also provide some mechanism to provide 
distinct information on what is local vs what is on the internet. 
Something that would make tools like spotlight much more valuable, IMHO, 
is to tell me what I have on my computer, and what I can get, if I want 
to; at least as some form of option.


   Robert

> 
> Duncan Murdoch
> 

-- 
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
206-667-7700
rgentlem at fhcrc.org



More information about the R-devel mailing list