Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: convenience function for saving graphs #14

Open
nateGeorge opened this issue Apr 17, 2019 · 0 comments
Open

Feature request: convenience function for saving graphs #14

nateGeorge opened this issue Apr 17, 2019 · 0 comments

Comments

@nateGeorge
Copy link

nateGeorge commented Apr 17, 2019

I plan on adding this later. A simple function to take care of saving the plot as an image file. Something like:

save.graph <- function(graph, filename, filetype = 'jpg') {
  html.file <- paste0(filename, '.html')
  jpg.file <- paste0(filename, '.', filetype)
  saveWidget(graph, html.file)
  webshot::webshot(html.file, file = jpg.file)
}

Considerations:

  • should it auto-load webshot and htmlwidgets?
  • should it auto-insall phantomjs if not installed?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant