testname123
testname123

Reputation: 1091

Arranging inputs with Shiny in R

I have these two checkbox groups, 'one' and 'two'....As you can see, they're stacked on top of each other, and they scroll endlessly down the page.

How can I put these checkbox groups next to each other instead of on top of each other?

   ui.r
 library(shiny)

    shinyUI(pageWithSidebar(

      # Application title
      headerPanel("Example"),


      sidebarPanel(
        checkboxGroupInput("one", "One:",letters[1:26]),
        checkboxGroupInput("two", "Two:",letters[1:26]),

      ),

      mainPanel(

      )
    ))

Upvotes: 3

Views: 1362

Answers (1)

Victorp
Victorp

Reputation: 13856

Hello you can do like this, but selectInput with multiple=TRUE is maybe more adapted for what you want.

shinyUI(pageWithSidebar(

  headerPanel("Example"),

  sidebarPanel(
    div(class="row-fluid",
        div(class="span3",
            checkboxGroupInput("one", "One:",letters[1:26])),
        div(class="span3",
            checkboxGroupInput("two", "Two:",letters[1:26]))),

    selectInput("three", label="Three", choices=letters, multiple=TRUE)

  ),
  mainPanel()
))

Upvotes: 3

Related Questions