| mwCheckboxGroup {manipulateWidget} | R Documentation |
Add a group of checkboxes to a manipulateWidget gadget
mwCheckboxGroup(choices, value = c(), label = NULL, ..., .display = TRUE)
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 |
... |
Other arguments passed to function |
.display |
expression that evaluates to TRUE or FALSE, indicating when the input control should be shown/hidden. |
A function that will generate the input control.
Other controls: mwCheckbox,
mwDateRange, mwDate,
mwGroup, mwNumeric,
mwPassword, mwRadio,
mwSelectize, mwSelect,
mwSharedValue, mwSlider,
mwText
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))
)
}