为tableOuput的每一行添加单选按钮

时间:2017-06-19 08:38:10

标签: r shiny radio-button

我是新手,我想为tableoutput的每一行添加一组radiobuttons。任何帮助都将深表感谢,这是我的代码

   library(shiny)

ui = fluidPage(

tableOutput("classification"), radioButtons("radio_year_select","Year", c("1999" = "1999", "2001" = "2001","2002" = "2002"), inline=T) )

server = function(input, output, session) {

sum_fred = reactive({

temp = data.frame(apply(iris,2, function(x) length(unique(x))))
temp$variable = colnames(iris)
temp$Type = lapply(iris, function(x) class(x))

colnames(temp)[1] = "Frequencies"
temp = temp[,c(2,3,1)]

})

output$classification = renderTable({sum_fred()})

} shinyApp(ui, server)

1 个答案:

答案 0 :(得分:0)

以下是您正在寻找的内容:radioButtons in DT