From ggrothendieck at gmail.com  Thu Jun  4 07:37:38 2009
From: ggrothendieck at gmail.com (Gabor Grothendieck)
Date: Thu, 4 Jun 2009 01:37:38 -0400
Subject: [Rd] proposed changes to RSiteSearch
In-Reply-To: <4A2752F8.1000502@free.fr>
References: <39B6DDB9048D0F4DAD42CB26AAFF0AFA07381973@usctmx1106.merck.com> 
	<39B6DDB9048D0F4DAD42CB26AAFF0AFA073C46FD@usctmx1106.merck.com> 
	<20090507180930.GA1619@psych.upenn.edu>
	<39B6DDB9048D0F4DAD42CB26AAFF0AFA073C4758@usctmx1106.merck.com>
	<4A032E6F.8010001@dbmail.com> <20090507192632.GA4723@psych.upenn.edu> 
	<39B6DDB9048D0F4DAD42CB26AAFF0AFA073C4844@usctmx1106.merck.com> 
	<4A26ED1D.1020407@prodsyse.com>
	<971536df0906031448g6679d461w438b2c7c67244eec@mail.gmail.com> 
	<4A2752F8.1000502@free.fr>
Message-ID: <971536df0906032237v349469a3p289002f432a8c6b5@mail.gmail.com>

If it were an entry on the Rgui menu on Windows then at
least Windows users could get to it quickly regardless of
the name.

2009/6/4 Romain Fran?ois <francoisromain at free.fr>:
> One other comment was that the function name is a pain to type, which I
> believe is also true for "RSiteSearch". Considering we (I) might add other
> engines, would it make sense to have a more generic name, ... something like
> "web.search", "doc.search", ...
>
>
> Gabor Grothendieck wrote:
>>
>> Having RSiteSearch.function be a strict superset of RSiteSearch might
>> make sense but giving them the same name seems too heavy
>> handed unless done via OO which seems not applicable here since
>> R's version is not generic and the two use the same class, "character",
>> anyways.
>>
>> On Wed, Jun 3, 2009 at 5:37 PM, spencerg <spencer.graves at prodsyse.com>
>> wrote:
>>
>>>
>>> Hello All:
>>>
>>> ? ?What do you think of adding a function "RSiteSeach" to the package of
>>> that name, masking the "RSiteSearch" function in "utils", trapping any
>>> call
>>> RSiteSearch('searchstring', 'function') to the current
>>> RSiteSearch.function
>>> and passing all others to "utils:::RSiteSearch"? ?This was suggested by a
>>> referee to a manuscript on this new capability submitted to "R Journal".
>>> ?The current version of this manuscript is available via
>>> "system.file('doc',
>>> 'RSiteSearch.pdf', package='RSiteSearch')" if you have the "RSiteSearch"
>>> package installed.
>>>
>>> ? ?Thanks,
>>> ? ?Best Wishes,
>>> ? ?Spencer
>>>
>>>
>>> Liaw, Andy wrote:
>>>
>>>>
>>>> ?I agree! ?Recall, though, I had added the RSiteSearch() functionality
>>>> to the Rgui under Windows (Help / search.r-project.org...), so if
>>>> RSiteSearch() is taken out, this need to go, too.
>>>>
>>>> Best,
>>>> Andy
>>>>
>>>> From: Jonathan Baron
>>>>
>>>>
>>>>>
>>>>> There is something to be said for taking all of these functions,
>>>>> including the original RSiteSearch, out of utils and putting them in
>>>>> the new RSiteSearch package. ?These are the sorts of things that will
>>>>> get revised frequently, and this way (I think) we won't have to bother
>>>>> whoever takes care of utils, which is part of the regular R
>>>>> distribution.
>>>>>
>>>>> I'm adding Spencer Graves to the cc list. ?Maybe he is interested in
>>>>> doing this.
>>>>>
>>>>> Jon
>>>>>
>>>>> On 05/07/09 20:54, Romain Francois wrote:
>>>>>
>>>>>
>>>>>>
>>>>>> We could have a few functions similar to RSiteSearch or
>>>>>>
>>>>>
>>>>> gmaneSearch I
>>>>>
>>>>>>
>>>>>> just posted and then cook a summary html page with R ...
>>>>>>
>>>>>> Here is a function that grabs relevant groups from gmane:
>>>>>>
>>>>>> gmaneGroups <- function( prefix = "gmane.comp.lang.r." ){
>>>>>> ? url <- URLencode( sprintf(
>>>>>> "http://dir.gmane.org/index.php?prefix=%s", prefix) )
>>>>>> ? txt <- grep( '^<tr.*<td align=right.*<a', readLines(
>>>>>>
>>>>>
>>>>> url ), value =
>>>>>
>>>>>>
>>>>>> TRUE )
>>>>>> ? ? rx <- '^.*?<a href="(.*?)">(.*?)</a>.*<td>(.*?)</td>.*$'
>>>>>> ? out <- data.frame(
>>>>>> ? ? ? url = gsub( rx, "\\1", txt ),
>>>>>> ? ? ? group = gsub( rx, "\\2", txt ),
>>>>>> ? ? ? description = gsub( rx, "\\3", txt ),
>>>>>> ? ? ? stringsAsFactors = FALSE
>>>>>> ? ? ? )
>>>>>> ? out$group <- sub( "...", ".*", out$group, fixed = TRUE )
>>>>>> ? out
>>>>>> }
>>>>>>
>>>>>> I'll clean this up and write a man page if there is
>>>>>>
>>>>>
>>>>> interest in adding
>>>>>
>>>>>>
>>>>>> this to R, but this might be more appropriate in a package,
>>>>>>
>>>>>
>>>>> for example:
>>>>>
>>>>>>
>>>>>> http://r-forge.r-project.org/projects/rsitesearch/
>>>>>>
>>>>>> Romain
>>>>>>
>>>>>> Liaw, Andy wrote:
>>>>>>
>>>>>>
>>>>>>>
>>>>>>> From: Jonathan Baron
>>>>>>>
>>>>>>>
>>>>>>>>
>>>>>>>> On 05/07/09 13:48, Liaw, Andy wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>>
>>>>>>>>> From: Duncan Murdoch
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> I'll incorporate the changes if you like
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>
>>>>>>>> Yes. ?Please do. ?I understand that it won't take effect
>>>>>>>>
>>>>>
>>>>> for a while.
>>>>>
>>>>>
>>>>>>>>
>>>>>>>> When it does, I'll change my site.
>>>>>>>>
>>>>>>>> ?What do you think
>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> of the idea of adding a gmane (or other archive) search to your
>>>>>>>>>> results page? ?Then if someone doesn't like what the man pages
>>>>>>>>>> show, you can
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>
>>>>>>>> send them
>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> somewhere else, rather than leaving them to find out the other
>>>>>>>>>> resources themselves.
>>>>>>>>>>
>>>>>>>>>> gmane has sample code for this on their search page
>>>>>>>>>> search.gmane.org, so it looks reasonably easy. ?I'd suggest
>>>>>>>>>> following their
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>
>>>>>>>> last example,
>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> with a drop-down box to select mailing lists, with comp.lang.r.*
>>>>>>>>>> as
>>>>>>>>>> an option for "all lists".
>>>>>>>>>>
>>>>>>>>>> Duncan Murdoch
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>
>>>>>>>> Good idea. ?I will do this. ?But there are also two
>>>>>>>>
>>>>>
>>>>> other good search
>>>>>
>>>>>
>>>>>>>>
>>>>>>>> engines. ?Maybe I'll add all three search alternatives.
>>>>>>>>
>>>>>
>>>>> But then,
>>>>>
>>>>>
>>>>>>>>
>>>>>>>> according to Sheena Iyengar, people won't choose any! ?Hmm.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>>
>>>>>>>>> Actually, I was thinking about a possible RHelpSearch() in
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>> addition, if
>>>>>>>>
>>>>>>>>
>>>>>>>>>
>>>>>>>>> Jon is no longer going to include the R-help archive in the
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>> search. ?I
>>>>>>>>
>>>>>>>>
>>>>>>>>>
>>>>>>>>> used the current RSiteSearch() a lot more for searching
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>> R-help archive
>>>>>>>>
>>>>>>>>
>>>>>>>>>
>>>>>>>>> than functions in packages. ?Ideas? ?comments?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>> This is OK with me, but I don't want to do it. ?I guess it would
>>>>>>>> search gmane. ?MarkMail is also pretty good, as is
>>>>>>>> http://tolstoy.newcastle.edu.au/R/ All these are much better than
>>>>>>>> Namazu for searching the R-help list.
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> Sorry I didn't make it clear: ?I meant something like the
>>>>>>>
>>>>>
>>>>> gmaneSearcg()
>>>>>
>>>>>
>>>>>>>
>>>>>>> that Romain posted, not hitting your site.
>>>>>>>
>>>>>>> Best,
>>>>>>> Andy
>>>>>>>
>>>>>>>
>>>>>>>>
>>>>>>>> Jon
>>>>>>>>
>>>>>>>>
>>>>>>
>>>>>> --
>>>>>> Romain Francois
>>>>>> Independent R Consultant
>>>>>> +33(0) 6 28 91 30 30
>>>>>> http://romainfrancois.blog.free.fr
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>> Jonathan Baron, Professor of Psychology, University of Pennsylvania
>>>>> Home page: http://www.sas.upenn.edu/~baron
>>>>> Editor: Judgment and Decision Making (http://journal.sjdm.org)
>>>>>
>>>>>
>>>>>
>>>>
>>>> Notice: ?This e-mail message, together with any attach...{{dropped:15}}
>>>>
>>>
>>> ______________________________________________
>>> R-devel at r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>>
>>>
>>
>> ______________________________________________
>> R-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>>
>>
>
>
> --
> Romain Francois
> Independent R Consultant
> +33(0) 6 28 91 30 30
> http://romainfrancois.blog.free.fr
>
>
>
>



[Rd] proposed changes to RSiteSearch
Gabor Grothendieck