【发布时间】:2019-07-26 17:58:33
【问题描述】:
我有一个反应式闪亮,它连接到 MySQL 并根据用户的输入呈现数据表。在表mytable中,
A 列的值 - Won 或 Lost
B 列的值 - Won 或 Lost 或 Tied
C 列的值 - 1 到 9
D 列的值 - 0 到 150
E 列的值 - 1 或 2
这 4 个值是根据用户输入选择的。 mytable 表还有其他列,例如 E 和 F,它们不依赖于用户输入。
ui <- fluidPage(fluidRow(
column(4,radioButtons("firstorsecond", "First or Second",
choices = c(1: 2),selected='1')),
column(4,radioButtons("anotherselection", "Choose won or lost",
choices = list("Won" = 1, "Lost" = 2),selected='1')),
column(4,radioButtons("result", "Match Result",
choices = list("Won" = 1, "Lost" = 2, "Tied"=3),selected='1')),
column(4,checkboxGroupInput("pos", "Position",
choices = c(1:9),inline = TRUE)),
column(4,sliderInput("range", "Score Range", min = 0,
max = 150,value = c(25,75))
))
)
server <- function(input, output)
{
rs=dbSendQuery(mydb,"select A,B,C,D,E,F from mytable where name='abcd'")
adv_ana=fetch(rs,n=-1)
dataInput<-reactive({
**code goes here**
})
}
在
dataInput<-reactive({}),帮我弄清楚如何获取输入 值并显示一个包含所有列的表格。
提前致谢。
【问题讨论】: