Skip to content
Prev 59932 / 398502 Next

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

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: