Skip to content
Prev 45025 / 398530 Next

browseURL question

One way to avoid this problem is to create a one line javascript
file which redirects to your url.  That way the shell never 
gets its hands on your url.  After setting the url:

url <- "http://search.yahoo.com/search?p=Bioconductor&ei=UTF-8&fr=fp-tab-web-t&n=20&fl=0&x=wrt"

Run these three lines of code (only tested on Windows/IE):

cat( "<script language=", "javascript", ">location=", 
            url, "</script>\n", sep="\"", file="temp.htm" )
browseURL("temp.htm")
unlink("temp.htm")


---
Date:   Sat, 28 Feb 2004 08:00:54 +0000 (GMT) 
From:   Prof Brian Ripley <ripley at stats.ox.ac.uk>
To:   <jtleek at u.washington.edu> 
Cc:   <r-help at stat.math.ethz.ch> 
Subject:   Re: [R] browseURL question 

 
The problem is the interpretation by the shell used on Unix: on Windows no
shell is used. It seems to me that the Unix version of browseURl should be
quoting `url' in

remoteCmd <- if (isLocal)
switch(basename(browser), "gnome-moz-remote" = , open = url,
galeon = paste("-x", url), kfmclient = paste("openURL",
url), netscape = , mozilla = , opera = , {
paste("-remote \"openURL(", gsub("([,)])", "%\\1",
url), ")\"", sep = "")
})
else url

either by escaping & by \ or surrounding it by single quotes.

I can't see a simple solution for you with the present R codebase.
On Fri, 27 Feb 2004 jtleek at u.washington.edu wrote: