11

UIにチェックボックスオプションを並べて表示できるかどうか疑問に思っていました。私が試したいくつかのサンプルコード:

shinyUI(pageWithSidebar(
  headerPanel("Example"),
  sidebarPanel(   
    checkboxInput(inputId = "simOption", label = "Historical Data",value=TRUE),
    checkboxInput(inputId = "simOption2", label = "Historical Data 2",value=TRUE)


  ),

  mainPanel(
tabsetPanel(

  tabPanel("Heatmap",
           plotOutput("temp")
  ),
  tabPanel("About"),

  id="tabs"
)#tabsetPanel  

  )#mainPane;

))
4

2 に答える 2

13

いくつかのブートストラップ構文をいじってみてください:

shinyUI(pageWithSidebar(
  headerPanel("Example"),
  sidebarPanel(   

    withTags(div(class='row-fluid',
                 div(class='span3', checkboxInput(inputId = "simOption", label = "Historical Data",value=TRUE)),
                 div(class='span5', checkboxInput(inputId = "simOption2", label = "Historical Data 2",value=TRUE))
    ))



  ),

  mainPanel(
tabsetPanel(

  tabPanel("Heatmap",
           plotOutput("temp")
  ),
  tabPanel("About"),

  id="tabs"
)#tabsetPanel  

  )#mainPane;

))

https://medium.com/what-i-learned-building/99fdd6e46586

水平ラジオボタンの編集

から?radiobutton

radioButtons("dist", "Distribution type:",
             c("Normal" = "norm",
               "Uniform" = "unif",
               "Log-normal" = "lnorm",
               "Exponential" = "exp"))

に置き換えます

 gsub("label class=\"radio\"", "label class=\"radio inline\"",radioButtons("dist", "Distribution type:",
             c("Normal" = "norm",
               "Uniform" = "unif",
               "Log-normal" = "lnorm",
               "Exponential" = "exp")))
  )
于 2013-06-24T14:08:45.503 に答える
13

パラメータcheckboxGroupInputで使用できます:inline = TRUE

checkboxGroupInput(inputId = "simOption", label = "",
                   choices = c("Historical Data" = TRUE,
                               "Historical Data 2" = TRUE),
                   inline = TRUE)
于 2015-03-10T19:02:46.753 に答える