我是新手,我想为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)