David Habier
David Habier

Reputation: 31

Automatically open R Shiny App in Chrome Web Browser only while Internet Explorer is the default browser

How to automatically open an R Shiny app only in the Chrome Web Browser, while Internet Explorer is the default browser?

Example of a run.r file:

require(shiny)
folder_address = 'C:/Temp/Test/'
runApp(folder_address,launch.browser=TRUE)

which is called by a .bat file:

START /MIN "" "R.exe" CMD BATCH "C:\Temp\Test\run.r"

I want to use runApp() and not open it through RStudio.

Upvotes: 1

Views: 2794

Answers (1)

David Habier
David Habier

Reputation: 31

I added the following line to .Rprofile, which is located in C:\Users\username\Documents:

options(browser="C:/Program Files (x86)/Google/Chrome/Application/chrome.exe")

Notice however that an R Shiny app launched in RStudio still opens in the default browser. In my case IE.

Upvotes: 1

Related Questions