From murdoch at stats.uwo.ca  Fri Apr 25 16:39:38 2008
From: murdoch at stats.uwo.ca (Duncan Murdoch)
Date: Fri, 25 Apr 2008 10:39:38 -0400
Subject: [Rd] RFC: What should ?foo do?
In-Reply-To: <f8e6ff050804250718u6cc654cboe02f3071c6d9cb24@mail.gmail.com>
References: <48110D8B.10300@stats.uwo.ca> <48115131.7000402@comcast.net>	
	<4811B9EC.3010701@stats.uwo.ca> <4811D298.4030102@biostat.ku.dk>
	<f8e6ff050804250718u6cc654cboe02f3071c6d9cb24@mail.gmail.com>
Message-ID: <4811ED2A.1070709@stats.uwo.ca>

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.

Duncan



[Rd] RFC: What should ?foo do?
Duncan Murdoch