manipulate: Manipulate command ala RStudio

Description Usage Arguments Value Examples

View source: R/manipulate.R

Description

Manipulate command ala RStudio

Usage

1
  manipulate(._expr, ...)

Arguments

._expr

expression to produce output.

...

used to specify controls. See picker, checkbox, slider.

These controls may also be specified through a object, from which the control is guessed. A logical maps to checkbox. A character maps to picker. A numeric to slider. This mapping can be specified as an arithmetic sequence of points (length 5 or greater), or as a numeric vector of length 2 to 4 with defaults like: c(min, max, step=1, initial=min)

Value

makes output, returns Manipulate object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
## Not run: 
## from RStudio::manipulate
manipulate(## expression
plot(cars, xlim = c(x.min, x.max), type = type,
axes = axes, ann = label),
## controls
x.min = slider(0,15),
x.max = slider(15,30, initial = 25),
type = picker("p", "l", "b", "c", "o", "h", "s"),
axes = checkbox(TRUE, label="Draw Axes"),
label = checkbox(FALSE, label="Draw Labels")
)
## using shortcuts, ala Mathematica's manipulate
manipulate(## expression
plot(cars, xlim = c(x.min, x.max), type = type,
axes = axes, ann = label),
## controls
x.min = 0:15,
x.max = c(15,30, 1, 25), ## min, max, step=min, initial=min
type = c("p", "l", "b", "c", "o", "h", "s"),
axes = TRUE,
label = FALSE
)

## End(Not run)

gWidgetsManipulate documentation built on May 2, 2019, 5:26 p.m.