[R] an R function to search on Prof. Baron's site

Tom Mulholland tmulholland at bigpond.com
Sat Nov 27 02:53:33 CET 2004


The problem appears to be associated with the "|"  in 
"Rhelp00/archive|Rhelp01/archive|Rhelp02a/archive". When you run the 
function in Firefox with restrict set to "doc" it gives the right response.

This function eventually uses system. So I decided to see if I could get 
this to work by hand using the code from browseURL

 > cmd
[1] "\"C:/Program Files/Internet Explorer/iexplore.exe\" 
http://finzi.psych.upenn.edu/cgi-bin/htsearch?config=htdigrun1;restrict=Rhelp00/archive|Rhelp01/archive|Rhelp02a/archive;format=builtin-long;sort=score;words=Ripley;matchesperpage=10"
 > system(cmd, wait = FALSE)

Works as expected since it does anyway. I make the assumption that I at 
least have the code correct.

 > cmd
[1] "\"C:/Program Files/Mozilla Firefox/firefox.exe\" 
http://finzi.psych.upenn.edu/cgi-bin/htsearch?config=htdigrun1;restrict=Rhelp00/archive|Rhelp01/archive|Rhelp02a/archive;format=builtin-long;sort=score;words=Ripley;matchesperpage=10"
 > system(cmd, wait = FALSE)

Falls over as previously described

I then thought that maybe quoting the search term would work, but this 
appears not to be the case.

As is noted in ?system "The command is run directly as a Windows command 
by the Windows API call 'CreateProcess'" Who knows what goes on in these 
processes. This is as far as I can go. It looks as if the API connection 
between system and Mozilla does not function the same way as with IE, 
and it is not obvious to me where the problem might be.

Tom Mulholland

R       R version 2.0.1, 2004-11-15
OS.type windows
GUI     Rgui

Andy Bunn wrote:
> Using this function with 2.0.0 XP and Firefox 1.0 (I've rediscovered the
> internet) produces a curious result.
> 
> 
>>myString <- RSiteSearch(string = 'Ripley')
>>myString
> 
> [1]
> "http://finzi.psych.upenn.edu/cgi-bin/htsearch?config=htdigrun1;restrict=Rhe
> lp00/archive|Rhelp01/archive|Rhelp02a/archive;format=builtin-long;sort=score
> ;words=Ripley;matchesperpage=10"
> 
>>version
> 
>          _
> platform i386-pc-mingw32
> arch     i386
> os       mingw32
> system   i386, mingw32
> status
> major    2
> minor    0.0
> year     2004
> month    10
> day      04
> language R
> 
> If no browser is open, then this is the URL that is browsed in Firefox:
> http://finzi.psych.upenn.edu/cgi-bin/htsearch?config=htdigrun1;restrict=Rhel
> p00/archive
> 
> Oddly, these two other windows are opened too:
> http://finzi.psych.upenn.edu/R/Rhelp01/archive/1000.html
> 
> and:
> http://www.mail-archive.com/r-help@stat.math.ethz.ch/msg17461.html
> 
> This happens regardless of what the search string is. If a browser window is
> open then everything works as planned. The sticky bit, obviously, is parsing
> browseURL which has the same behavior if I try:
> 
>>browseURL(myString)
> 
> 
> However, the searches:
> 
>>RSiteSearch(string = 'browseURL Firefox')
>>RSiteSearch(string = 'browseURL Mozilla')
> 
> 
> don't turn up much help! If I change browseURL to use IE then browseURL
> behaves as expected:
> 
> 
>>browseURL(myString, browser="C:/Program Files/Internet
> 
> Explorer/iexplore.exe")
> 
> Specifying Firefox explicitly in browseURL doesn't help - It still opens
> three windows as above (if no browser is open):
> 
> 
>>browseURL(myString, browser="C:/Program Files/Mozilla
> 
> Firefox/firefox.exe")
> 
> So, under Windows the 'NULL' argument in 'browser' which determines the
> browser via file association isn't the problem.
> 
> Anybody know how I can make Firefox work a little more smoothly?
> 
> Thanks, Andy
> 
> 
> 
> 
>>-----Original Message-----
>>From: r-help-bounces at stat.math.ethz.ch
>>[mailto:r-help-bounces at stat.math.ethz.ch]On Behalf Of Gabor Grothendieck
>>Sent: Tuesday, November 23, 2004 11:56 PM
>>To: r-help at stat.math.ethz.ch
>>Subject: Re: [R] an R function to search on Prof. Baron's site
>>
>>
>>Liaw, Andy <andy_liaw <at> merck.com> writes:
>>
>>:
>>: Inspired by the functions that Barry Rawlingson and Dave
>>Forrest posted for
>>: searching Rwiki and R-help archive, I've made up a function
>>that does the
>>: search on Prof. Baron's site (Thanks to Prof. Baron's help on
>>setting up the
>>: query string!):
>>
>>It would be nice if this and the other search functions recently
>>posted were collected into a package or even integrated into
>>R itself.  In the case of the Windows Rgui, it would be nice if they
>>appeared on a menu with the other search and help functions.
>>
>>______________________________________________
>>R-help at stat.math.ethz.ch mailing list
>>https://stat.ethz.ch/mailman/listinfo/r-help
>>PLEASE do read the posting guide!
>>http://www.R-project.org/posting-guide.html
>>
> 
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>




More information about the R-help mailing list