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') | |
| )) |
Hi yihui,
This is really a very helpful information. However, I am getting the following warning while executing "app".
Warning in file.rename(out, file) : cannot rename file 'input.pdf' to '/tmp/RtmpAeLXey/file1c6b135b80b9.pdf', reason 'Invalid cross-device link'No output file is being created after...
Will you please help me how to solve this? Thanks