I'm looking for a way to render my plot_ly plot directly to a browser in stead of r-studios default viewer. I've searched the plotly documentation but I only see a reference to the default behavior of opening the plot to a browser when running r from a terminal.
Does anyone know how to open to a browser window by default? Maybe a parameter to the plotly layout() option?
In general, there are four different approaches you can take in order to display plotly figures: Using the renderers framework in the context of a script or notebook (the main topic of this page) Using Dash in a web app context. By exporting to an HTML file and loading that file in a browser immediately or later.
By default, Plotly for R runs locally in your web browser or in the R Studio viewer. Simply printing the Plotly object will render the chart locally in your web browser or in the R Studio viewer. Plotly graphs are interactive.
plotly is an R package for creating interactive web-based graphs via the open source JavaScript graphing library plotly. js . As of version 2.0 (November 17, 2015), graphs created with the plotly R package are rendered locally through the htmlwidgets framework.
If you are creating R charts in an RMarkdown environment with HTML output (such as RStudio), simply printing a graph you created using the plotly R package in a code chunk will result in an interactive HTML graph in the viewer.
Alright I found a simple solution in the related questions section next to my original question. Sorry I didn't find it before. stackoverflow.com/questions/36868743 . Setting: options(viewer=NULL) in the script disables the viewer and opens my plot in the browser. Not really elegant and how to turn the default viewer back on is still a little mystery.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With