O'Reilly logo

R Data Analysis Cookbook - Second Edition by Kuntal Ganguly

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

  1. Open RStudio and load the app.R file from File | Open File. The app.R file contains Shiny ui code to select the x axis value of the plot that will be embedded in the dynamic report. The parameter values from the selectInput widget will be passed to the shiny server code:
ui = fluidPage(  selectInput("select", "Select X axis",              choices = c("weight","cylinders","acceleration")),  downloadButton("report", "Generate report"))
  1. The following shiny server code takes the selected input values of the ui panel. It then passes this parameter value along with the R markdown filename to the rmarkdown::render() function to generate downloadable dynamic reports based on the parameter passed, and saves the output in either .html or .pdf

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required