【问题标题】:Add radio buttons for each row of an tableOuput为 tableOutput 的每一行添加单选按钮
【发布时间】:2017-06-19 21:20:53
【问题描述】:

我是闪亮的新手,我想为表格输出的每一行添加一组单选按钮。任何帮助将不胜感激,这是我的代码

   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)

【问题讨论】:

  • 你最终想要达到什么目的?

标签: r shiny radio-button


【解决方案1】:

这正是您要查找的内容:radioButtons in DT

【讨论】:

  • 谢谢,但我已经找到了这个解决方案,但我想创建不在 Html 中的单选按钮,而且这个解决方案不起作用,我认为问题出在我的数据存储在反应式中()
猜你喜欢
  • 2018-08-19
  • 1970-01-01
  • 2022-01-06
  • 2023-03-06
  • 1970-01-01
  • 1970-01-01
  • 2012-09-26
  • 2017-09-29
  • 2018-07-01
相关资源
最近更新 更多