如何在PDF中下载输出文本R闪亮

时间:2016-04-07 22:52:50

标签: r shiny shiny-server

我需要下载我的闪亮应用程序的结果PDF,其中打印用户选择文本。我不知道如何使用downloadHandler打印文本 谢谢

ui.R

library(shiny)
>
>shinyUI(fluidPage(
 > titlePanel("1.7"),
  sidebarLayout(
    sidebarPanel(
      selectInput(inputId = "variable1", label = "seleccione asignatura", choices = c("uno", "diseño máquinas 2", "CADcam", "teoría de mecanismos")),
      selectInput(inputId = "variable2", label = "seleccione profesor", choices = c("profesor 1", "profesor 2", "profesor 3", "profesor 4")),
      selectInput(inputId = "variable3", label = "seleccione especialidad", choices = c("mecánica", "diseño", "posgrado")),
      selectInput(inputId = "variable4", label = "seleccione horario", choices = c("lunes", "martes", "miércoles", "jueves", "viernes"), multiple = TRUE),
      radioButtons(inputId = "variable5", label = "seleccione tipo de formulario", choices = list("formulario 1", "formulario 2")),
      downloadButton('downloadData', 'Download')
    ),
    mainPanel(
      textOutput("text")
    )
  )))

server.R

>library(shiny)

>shinyServer(function(input, output){
>  output$text <- renderText(paste("El profesor",input$variable2,"ha cursado la asignatura de ",input$variable1,"en la especialidad de ",input$variable3,"en los horarios de ",input$variable4))


 > output$downloadData <- downloadHandler(


>    filename = function() {
      paste(input$variable5, "pdf", sep = ".") 

>    },
    #here is where I need help
  >  content = function(file) {
      #no idea
    }
  )
})

0 个答案:

没有答案