To see this app in action, run this in R:
library(shiny)
runGist('https://gist.github.com/yihui/6091942')
\documentclass{article} | |
\begin{document} | |
<<names>>= | |
input$firstname | |
input$lastname | |
@ | |
\end{document} |
library(knitr) | |
shinyServer(function(input, output) { | |
output$report = downloadHandler( | |
filename = 'myreport.pdf', | |
content = function(file) { | |
out = knit2pdf('input.Rnw', clean = TRUE) | |
file.rename(out, file) # move pdf to file for downloading | |
}, | |
contentType = 'application/pdf' | |
) | |
}) |
library(shiny) | |
shinyUI(basicPage( | |
textInput('firstname', 'First name', value = 'Jimmy'), | |
textInput('lastname', 'Last name', value = 'John'), | |
downloadButton('report') | |
)) |