1

I am trying to export an interactive graph to the browser (rather than the Rstudio viewer). I know this is possible (by default) with standard R.

How would I do this with Rstudio? This works in R:

library(networkD3)
simpleNetwork(MY_FILE) #displays in browser
Rilcon42
  • 9,584
  • 18
  • 83
  • 167
  • What code are you running? Please provide a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). How is Rstudio specifically causing a problem? – MrFlick May 14 '15 at 14:53
  • Rstudio is not causing a problem, I just dont know how to do this is Rstudio whereas it happens by default in R. – Rilcon42 May 14 '15 at 15:04
  • There is a button in RStudio viewer (top right, "show in new window"). Or type `g1 <- simpleNetwork(NetworkData); htmltools::html_print(g1, viewer = utils::browseURL)` – bergant May 14 '15 at 19:38
  • @bergant, That fixed my problem. If you will propose it as a solution I will be happy to accept it! – Rilcon42 May 14 '15 at 19:41

1 Answers1

1

There is a button in RStudio viewer (top right, "show in new window").

Or use htmltools::html_print and specify viewer function:

g1 <- simpleNetwork(NetworkData)
htmltools::html_print(g1, viewer = utils::browseURL)
bergant
  • 7,122
  • 1
  • 20
  • 24