Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set default browser to Internet Explorer in R?

I am rarely using IE for web browsing, so would like R help opens in it when calling help functions. Currently it opens my default web browser (Chrome). I would like to leave system-wide default browser intact, but change browser only for R.

Is it possible?

I found some texts about how to edit Rprofile.site, but failed to deduce how to set for IE and Windows.

like image 557
Suzan Cioc Avatar asked Apr 14 '15 10:04

Suzan Cioc


People also ask

How do I change my default browser in R?

The default browser is set by option "browser" , in turn set by the environment variable R_BROWSER which is by default set in file R_HOME /etc/Renviron to a choice made manually or automatically when R was configured.

How do I make Internet Explorer my default browser instead of Edge?

Select the Start button, and then type Default apps. In the search results, select Default apps. Under Web browser, select the browser currently listed, and then select Microsoft Edge or another browser.

How do I turn on Internet Explorer?

Select Start > Search , and enter Windows features. Select Turn Windows features on or off from the results and make sure the box next to Internet Explorer 11 is selected. Select OK, and restart your device.


1 Answers

A solution could be to create a file named .Rprofile in your home directory and put the following line:

 options(browser="path/to/IE")

Of course, you have to replace the path/to/IE part to the actual path to the IE executable (could be something like C:\\Program Files\\Internet Explorer\\iexplore.exe\).

Restart R and try for instance browseURL("www.google.com") to see if it has taken effect.

like image 159
nicola Avatar answered Nov 06 '22 07:11

nicola