0
我想用selectInput
函數得到表格輸出。 我必須導入(不上傳)不同的csv文件來代替對象錯誤1,2,3,4,但是當我這樣做時,我在mainPanel
中得不到正確的輸出。請幫助我在正確的位置導入csv文件,以便我可以在mainpanel中將表格作爲輸出。如何使用selectInput函數獲取表格或數據框作爲R閃亮應用程序中的輸出?
library(shiny)
ui <- shinyUI(fluidPage(
titlePanel(h3("PUMA", style = "color:black")),
sidebarLayout(
sidebarPanel(
tags$head(
tags$style("body{backgroud-color: pink;}")),
selectInput("mydata", "ERROR MESSAGE:",
choices = c("Clamping lever closing not detected-Error number 7/31"="error1",
"Filter paper wrong or not inserted-Error number 30/20"="error2",
"Device is heating up (working temp. not reached yet) Heating Option-Error number 32/51"="error3",
"Door is open (Timeout key)-Error number 15/100"="error4")
)
),
mainPanel(tabsetPanel(
tabPanel(h2("TABLE", style = "color:red"), verbatimTextOutput ("mydata")),
#tabPanel(h2("ERROR", style = "color:red"), verbatimTextOutput("ERROR")),
tags$head(tags$style("#mydata{color:blue;
font-size: 17px;
font-style: bold
}"))
),
width = 12)
)))
server <- shinyServer(function(input, output){
output$mydata <-renderPrint ({
input$mydata
})
})
shinyApp(ui = ui, server = server)
不清楚自己想要什麼。你期望的正確輸出是什麼?要上傳csv,您可以嘗試[this](http://shiny.rstudio.com/gallery/file-upload.html)。 – Jimbou
在error1中有一個數據幀,我希望該數據幀作爲輸出。例如從sidebarpanel如果我選擇「夾緊槓桿關閉未檢測到 - 錯誤號碼7/31」,那麼我應該得到一個數據框,它存儲在對象error1作爲我的主面板輸出。 –