【发布时间】:2020-06-30 17:18:11
【问题描述】:
我有一份清单
PID_short PID_full
420 44101445
419 44101375
418 44101344
417 44100125
416 44095813
415 44100240
data <- data.frame(PID_short = seq(from = 420, to = 415, by = -1),
PID_full = c(44101445, 44101375, 44101344, 44100125, 44095813, 44100240))
我想创建一个图形用户界面,当我输入PID_short 时,它会显示PID_full。
例如,当我输入420 时,它会显示44101445。
我对@987654327@ 真的很陌生。但我试过了,这是我的代码:
library(shiny)
ui <- shinyUI(fluidPage(
titlePanel(title=h3("Please select the information :", align = "center")),
sidebarLayout(
sidebarPanel(
sliderInput("slide","Select the value of PID_short ", min = 415, max = 420, value = 417)
),
mainPanel(
textOutput("out")
))))
server <- shinyServer(function(input,output){
output$out <- renderText(
paste("The PID_full is:",input$slide)
)})
shinyApp(ui = ui, server = server)
我应该在哪里修改我的代码?或者我应该如何以更好的方式写作?请帮助我...我将不胜感激。
【问题讨论】:
标签: r user-interface shiny