[R-SIG-Mac] How to correctly set up a browser on Mac?

Marius Hofert marius.hofert at math.ethz.ch
Tue Feb 28 12:44:23 CET 2012

Dear Mac-expeRts,

I work with R version 2.14.0 (2011-10-31) (Platform:
x86_64-apple-darwin11.2.0/x86_64 (64-bit)) and recently realized that
help.start() does not work as expected. I soon found out that
options(browser="chrome") in my ~/.Rprofile is not valid, "sh" does not find the
command "chrome". How can I correctly set up Google Chrome as default browser in options()?

Here is what I tried:
I know that on a Mac (MacBook Air with 10.7.3 in my case), one can open
applications via "open -a ...". I tried options(browser="open -a
/Applications/Google Chrome.app") with various forms of escaping the blank, but
it did not work. I then used the following trick. I created a file "mybrowser"
in /bin which contains just this line:
open -a "/Applications/Google Chrome.app"

Now I can open Chrome with no error, but help.start() still did not show any
output. On debugging help.start(), I found out that a simple command such
browseURL("http://www.google.com") makes Chrome "active", but the url is not
visited, so my options-setup of "browser" is certainly wrong.



More information about the R-SIG-Mac mailing list