Minimum checkbox selection

Is there anyway I can let a group of checkboxes have at least one choice?

I would like the vector to have at least one selection instead of zero. Is it possible to change the input element if this checkbox group doesn't support UI.R

library(shiny)

# Define UI for miles per gallon application
shinyUI(pageWithSidebar(

  # Application title
  titlePanel("Demo Assignment for SHINY Coursera"),

  # Sidebar with checkbox to select the variable to plot against mpg
  # and to specify whether outliers should be included
  sidebarPanel(



    selectInput("variable1", "Performance Variable:",
                list("MPG" = "mpg", 
                     "qsec" = "qsec")),

    checkboxGroupInput("variable", "Variable:",
                       c("Cylinders" = "cyl", 
                         "Displacement" = "disp", 
                         "HP" = "hp", 
                         "Rear Axle Ratio" = "drat", 
                         "Weight" = "wt", 
                         "Transmission" = "am", 
                         "Carburetors" = "carb", 
                         "Gears" = "gear"), selected = "cyl")


  ),

  # Show the caption and plot of the requested variable against mpg
  mainPanel(

    h4(textOutput("Var_1")),
    h4(textOutput("Var_2")),
    h4(textOutput("caption")),

    h4("Analysis:"),

    plotOutput("mpgPlot")
  )
))

      

+3
r shiny


source to share


No one has answered this question yet

Check out similar questions:

eleven
R Shiny: Side by Side Checkbox
five
R Shiny checkboxGroupInput - Select all checkboxes by clicking
2
Summary statistics grouped by multiple columns in the corresponding columns corresponding to them
0
choice of flag combination shiny R
0
checkbox not selected in shiny app
0
Shiny - check box on the table in shiny
0
R Shiny: Computing not working on some versions of R
0
tidyverse method for reading the CSV section
0
create table from framework using RODBC
0
R, an automatic linear regression loop using the same IVs on different DVs to keep the coefficients



All Articles
Loading...
X
Show
Funny
Dev
Pics