[Rd] RFC: What should ?foo do?

Duncan Murdoch murdoch at stats.uwo.ca
Fri Apr 25 16:39:38 CEST 2008

On 4/25/2008 10:18 AM, hadley wickham wrote:
> On Fri, Apr 25, 2008 at 7:46 AM, Peter Dalgaard
> <P.Dalgaard at biostat.ku.dk> wrote:
>> Duncan Murdoch wrote:
>>  > I haven't done it, but I suspect we could introduce special behaviour
>>  > for ??foo very easily.  We could even have a whole hierarchy:
>>  >
>>  > ?foo, ??foo, ???foo, ????foo, ...
>>  >
>>  >
>>  Heh, that's rather nice, actually. In words, that could read
>>  ?foo: tell me about foo!
>>  ??foo: what can you tell me about foo?
>>  ???foo: what can you tell me about things like foo?
>>  ????foo: I don't know what I'm looking for but it might be something
>>  related foo?
> I like the idea, but why do not it automatically and then display the
> results on a single page?  (i.e. list results in order of specificity)

One reason not to do that is that in single-threaded R you are pretty 
much stuck until it is done.  Presumably the more specific search is 
quicker than the less specific one.  And even if we could act on results 
as soon as they were available, I think a lot of users would wait for 
the search to stop, so there'd be a perception that it was too slow.

One possible change to ?foo that would not be so painful for old-time 
users would be to try it under its current meaning first, and only fall 
back to a more general search if that fails.

Consistent with this idea would be something like the "I feel lucky" 
search on Google, i.e. ?foo would go immediately to the best match, 
while ??foo would present a list of possible matches.  This is not 
consistent with current behaviour, where ?foo will present a list if it 
matches two or more topics, but I think we can always rank one ahead of 
the other based on their ordering in the search list.  I don't know if 
it will be so easy to rank hits coming from help.search(), or from other 
searches that don't exist yet:  but maybe it doesn't matter.  If someone 
doesn't like what they get from ?foo, they can always try ??foo.


More information about the R-devel mailing list