Plotly in viewer can't save as image

plotly

#1

Hi, I have created plotly visualisations which are displayed in Studio 3.5.0 viewer. There's an option to save as image but after clicking save, the file is not saved as png/jpeg in my directory. I could only save as webpage html.

Pls advise how could I save as image.

Thanks.


#2

The RStudio Viewer pane can be used to view local web content,

For example, web graphics generated using packages like googleVis, htmlwidgets, and rCharts, or even a local web application created using Shiny, Rook, or OpenCPU.

Note that the Viewer pane can only be used for local web content. This content can either be static HTML files written to the session temporary directory (i.e. files with paths generated by the tempfile function) or a locally run web application. For example, to display generated HTML content you would use code like this:

The down-and-dirty way to save an image from the viewer pane is to take a screenshot.

Alternatively, you can save the image with a bit of extra r-code. Have a look at ploy.ly's docs: