2

我在闪亮包中创建了下拉列表。我无法用我的数据库表中的列填充它。

用户界面

library(shiny)

shinyUI(fluidPage(

h2("DATA ANIMATION"),




 sidebarLayout(

sidebarPanel(

 uiOutput("names")
 selectInput("School",label="School",choices=c('ABSC','ASDJ','KJRH')),
 selectInput("Standard",label="Standard",choices=c('1','2','3','4')),
 selectInput("Section",label="Section",choices=c('A','B','C')),
 selectInput("Subject",label="SUBJECT",choices=c('ENG','MATH','SCI')),
             sliderInput("slide", "select exam:", 
                         min = 1, max = 4, value = 1,animate=T)

),
  mainPanel(
     h4("GRAPH")

  )
 ))
)

服务器.r

library(shiny)
library(RODBC)
db <- odbcConnect("Classic")


shinyserver(
function(input,output){
output$names<-renderUI({
  selectInput("names", "Select Data", choices=getData(), selected=names[1])
})


}
)

全球.r

getData<- function()
{ 

 }

我还使用 RODBC 连接了 R 中的数据库。我在 SQLYOG 中有查询。

"SELECT DISTINCT a.name FROM schools a, years b, contracts c
WHERE a.current_year_id = b.id AND b.name = '2014-2015'
AND a.id = c.school_id "

仅显示一列。我希望在我的下拉列表中填充此列。

4

0 回答 0