Shiny plots PDF export

December 28, 2017
By

(This article was first published on R – MYHAPPYDATA BLOG, and kindly contributed to R-bloggers)

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 on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



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)