Message-ID: <A821F542-A5AB-43A4-9030-38F02D35DC56@me.com>
Date: 2018-08-04T12:18:29Z
From: Marc Schwartz
Subject: How to change default Browser for R
In-Reply-To: <CA+dpOJn6cm07OVvtAnah_JoxY5FdsGeBi0ZkxBmciuCnoQdA_Q@mail.gmail.com>
> On Aug 4, 2018, at 2:41 AM, Christofer Bogaso <bogaso.christofer at gmail.com> wrote:
>
> Hi,
>
> In my Mac, I have 2 browsers installed :
>
> Chrome (system default)
> Google Chrome Canary
>
> While for my regular browsing work I use Chrome, However for R I prefer to
> use Canary (like, opening Help page). Is there any way to set Canary only
> for R, however keeping system default unchanged.
>
> Thanks for your feedback.
Hi,
There are several steps involved during R ?Startup that set system and session specific ?options.
In your ~/.Rprofile, for session specific settings, you can add something like the following:
options(browser = "/usr/bin/open -a '/Applications/Google Chrome.app'")
replacing the Chrome binary filename above with the Canary name.
Be sure to exit your R session after setting the above, then start a new session to pick up the change.
The above works for me, to change the default from Safari to Chrome, just within my R session, without affecting the system default.
Regards,
Marc Schwartz