Dovini Jayasinghe
Dovini Jayasinghe

Reputation: 272

How to save R interactive plots (e.g. plotly plots) in Linux?

I have created an interactive plot using plotly (with tooltips). I am using Linux command line interface.

  1. Is it mandatory to use RStudio to save these interactive plots as they are (not as static plots)?
  2. Can R (not R studio) do this, and if yes, how?
  3. If I am running in Linux, how to save this kind of plot (e.g. as an html file or something smilar)?

Thanks

PS: I have tried htmlwidgets but it failed with the error:

 htmlwidgets::saveWidget(as_widget(p), file = "my_plot.html")
Error in pandoc_self_contained_html(file, file) :
  Saving a widget with selfcontained = TRUE requires pandoc. See here to learn more https://bookdown.org/yihui/rmarkdown-cookbook/install-pandoc.html

NOTE: htmlwidgets option works in Windows. My problem is with Linux.

Upvotes: 0

Views: 24

Answers (0)

Related Questions