checkbox: Create a checkbox control

Description Usage Arguments Value See Also Examples

View source: R/manipulate.R

Description

Create a checkbox control to enable manipulation of logical plot variables.

Usage

1
checkbox(initial = FALSE, label = NULL)

Arguments

initial

Initial value for checkbox. Must be logical (defaults to FALSE).

label

Display label for checkbox. Defaults to the variable name if not specified.

Value

An object of class "manipulator.checkbox" which can be passed to the manipulate function.

See Also

manipulate, slider, picker, button

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 

## Using checkboxes for boolean parameters
manipulate(
  plot(cars, axes = axes, ann = label),
  axes = checkbox(TRUE, "Draw Axes"),
  label = checkbox(FALSE, "Draw Labels"))

## Toggle boxplot outlier display using checkbox
manipulate(
  boxplot(Freq ~ Class, data = Titanic, outline = outline),
  outline = checkbox(FALSE, "Show outliers"))


## End(Not run)

manipulate documentation built on May 2, 2019, 3:27 a.m.