0

When I run

#get the library
library(googlesheets)
#initialize token
gs_auth(new_user = TRUE)

it always opens my firebox browser, however, I want it to open my chrome browser, is there a way to change the default open browser?

By the way, my os is windows 7
R version 3.3.3
googlesheets version 0.3.0

cloudscomputes
  • 1,278
  • 13
  • 19

1 Answers1

1

You can set which browser to launch from your R session with options(browser = "/path/to/executable"). To launch a Chrome browser on windows this may look like:

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

NB: the same command can be used to specify the browser in which to launch a shiny application, see e.g. Opening Shiny App directly in the default browser

Joris C.
  • 5,721
  • 3
  • 12
  • 27
  • Thanks! it works for me~ by the way, can you explain why it is always firefox initially even I change my system default browser to chrome? I checked the initial browser option in R and it is not firefox, but without your new setting it always turned to firefox, thanks! – cloudscomputes Jun 21 '19 at 02:30
  • The Details section of `?utils::browseURL` might be useful in explaining default browser behavior. Another link to temporarily change the default browser for `gs_auth`: https://cran.r-project.org/web/packages/googlesheets/vignettes/alternative-browser.html – Joris C. Jun 21 '19 at 07:33