mwCheckboxGroup: Add a group of checkboxes to a manipulateWidget gadget

Description Usage Arguments Value See Also Examples

View source: R/inputs.R

Description

Add a group of checkboxes to a manipulateWidget gadget

Usage

1
mwCheckboxGroup(choices, value = c(), label = NULL, ..., .display = TRUE)

Arguments

choices

Vector or list of choices. If it is named, then the names rather than the values are displayed to the user.

value

Vector containing the values initially selected

label

Display label for the control. If NULL, the name of the corresponding variable is used.

...

Other arguments passed to functioncheckboxGroupInput

.display

expression that evaluates to TRUE or FALSE, indicating when the input control should be shown/hidden.

Value

A function that will generate the input control.

See Also

Other controls: mwCheckbox(), mwDateRange(), mwDate(), mwGroup(), mwNumeric(), mwPassword(), mwRadio(), mwSelectize(), mwSelect(), mwSharedValue(), mwSlider(), mwText()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
if (require(plotly)) {
  manipulateWidget(
    {
      if (length(species) == 0) mydata <- iris
      else mydata <- iris[iris$Species %in% species,]

      plot_ly(mydata, x = ~Sepal.Length, y = ~Sepal.Width,
              color = ~droplevels(Species), type = "scatter", mode = "markers")
    },
    species = mwCheckboxGroup(levels(iris$Species))
  )
}

manipulateWidget documentation built on Oct. 5, 2021, 9:10 a.m.