mardi 24 février 2015

How to arrange different UI input elements(checkboxes, radio inputs,etc) in Shiny?



  1. Based on user's selection my Shiny application should generated a variable number of checkbox and I would like to display them in a row/column format. (Shiny gives the horizontal and vertical option via inline argument but I want the display in matrix type format.) How you do that? Also, I would like to have them displayed in the user input area instead of the main panel right below user's selection box, selectInput.




  2. Is there a push button in Shiny that I can use instead checkbox?




Here are my scripts:


ui.R



library(shiny)
library(shinythemes)
shinyUI(fluidPage(theme = shinytheme("cerulean"),
# Title
headerPanel(title = "Run selection", windowTitle = "Run selection" ),

sidebarLayout(
sidebarPanel(

selectInput(runName, paste0('Select your run'), choices = runs),

lapply(runsRange, function(i) {
checkboxGroupInput("selectRuns", i, choices = "", inline = TRUE)
})
),

mainPanel()
)
))


server.R



library(shiny)
library(shinythemes)

shinyServer(function(input, output) {})




Aucun commentaire:

Enregistrer un commentaire