Description Usage Arguments Value See Also Examples
Create a picker control to enable manipulation of plot variables based on a set of fixed choices.
1 |
... |
Arguments containing objects to be presented as choices for the picker (or a list containing the choices). If an element is named then the name is used to display it within the picker. If an element is not named then it is displayed within the picker using |
initial |
Initial value for picker. Value must be present in the list of choices specified. If not specified defaults to the first choice. |
label |
Display label for picker. Defaults to the variable name if not specified. |
An object of class "manipulator.picker" which can be passed to the manipulate
function.
manipulate
, slider
, checkbox
, button
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 26 27 28 29 30 | ## Not run:
## Filtering data with a picker
manipulate(
barplot(as.matrix(longley[,factor]),
beside = TRUE, main = factor),
factor = picker("GNP", "Unemployed", "Employed"))
## Create a picker with labels
manipulate(
plot(pressure, type = type),
type = picker("points" = "p", "line" = "l", "step" = "s"))
## Picker with groups
manipulate(
barplot(as.matrix(mtcars[group,"mpg"]), beside=TRUE),
group = picker("Group 1" = 1:11,
"Group 2" = 12:22,
"Group 3" = 23:32))
## Histogram w/ picker to select type
require(lattice)
require(stats)
manipulate(
histogram(~ height | voice.part,
data = singer, type = type),
type = picker("percent", "count", "density"))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.