library(shiny)
library(DT)
ui <- fluidPage(
shiny::verbatimTextOutput(outputId = "rad_buts"),
DT::dataTableOutput("futureData")
)
server <- function(input, output, session) {
output$futureData <- DT::renderDataTable({
x <- data.frame(
Field = c("DDD", "EEE", "WWW", "RRR"),
a = c("Yes", "No", "Yes", "Yes"),b = c("No", "No", "Yes", "No"), c = c("Yes", "Yes", "Yes", "No"),
d = c("Yes", "Yes", "Yes", "Yes")
,
e = c(
as.character(radioButtons("radioDDD",
label = h6("radioDDD"),
choices = list("Choice 1" = 1, "Choice 2" = 2, "Choice 3" = 3),
selected = 1
)),
as.character(radioButtons("radioEEE",
label =h6("radioEEE"),
choices = list("Choice 1" = 1, "Choice 2" = 2, "Choice 3" = 3),
selected = 1
)),
as.character(radioButtons("radioWWW",
label = h6("radioWWW"),
choices = list("Choice 1" = 1, "Choice 2" = 2, "Choice 3" = 3),
selected = 1
)),
as.character(radioButtons("radioRRR",
label = h6("radioRRR"),
choices = list("Choice 1" = 1, "Choice 2" = 2, "Choice 3" = 3),
selected = 1
))
)
)
DT::datatable(data=x,
options = list(
drawCallback= JS(
'function(settings) {
Shiny.bindAll(this.api().table().node());}')
),selection='none',escape=F) %>% formatStyle(names(x), `font-size` = '8px')
})
output$rad_buts <- renderPrint({
paste0(input$radioDDD,
input$radioEEE,
input$radioWWW,
input$radioRRR,
collapse = "\n")
})
}
shinyApp(ui, server)