Skip to content
Prev 155672 / 398502 Next

RSiteSearch for words ``as one entity''.

On Wed, Sep 10, 2008 at 3:09 PM, Marc Schwartz
<marc_schwartz at comcast.net> wrote:
Yes, on key to solve this is to see what is passed to browseURL().

May I bet you that nothing is added and the problem is that the URL
end up with a single slash?  I believe that the browser (or whatever
tries to open the URL) that 1) does not identify a <protocol>://
prefix in the URL, 2) instead concludes that the URL specifies a local
file, and 3) tries to open it as if it had protocol file:// prefix.
If changing setwd(), changes the prefix, I think that is what happens.
Also, from the specification of 'Uniform Resource Locators (URL)'
[http://www.ietf.org/rfc/rfc1738.txt], one can read in Section 2.2:
"... only alphanumerics, the special characters "$-_.+!*'(),", and
reserved characters used for their reserved purposes may be used
unencoded within a URL."  Note also that curly brackets are listed
under the "Unsafe:" paragraph.   Thus, one could indeed argue that it
a bug that RSiteSearch() or browseURL() does not encode the URL
correctly.

I have a poor man URL encoder in R.utils called toUrl().  Try to see
the 2nd call below works:

url <- "http://search.r-project.org/cgi-bin/namazu.cgi?query={logistic+regression}";
browseURL(url);

library("R.utils");
browseURL(toUrl(url));

If the 1st fail and the 2nd works that is also a clue.

That's definitely my $.02

/Henrik