Shiny plots PDF export

December 28, 2017
By

[This article was first published on R – MYHAPPYDATA BLOG, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Sometimes it is useful to build a pdf export option into a Shiny app. I built a basic app at first (every important notes was included as comment) to show how to do it easily:

server.r

ui.r

You can also export the ggplot2 type plots like this:

server.r

final notes: If You would like to use Cairo on Ubuntu You need to run this commands at first:

sudo apt-get install libcairo2-dev
sudo apt-get install libxt-dev

To leave a comment for the author, please follow the link and comment on their blog: R – MYHAPPYDATA BLOG.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers

Sponsors

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)