corrade-nucleus-nucleons – Blame information for rev 20

Subversion Repositories:
Rev:
Rev Author Line No. Line
20 office 1 \name{picker}
2 \alias{picker}
3 \title{Create a picker control}
4 \description{
5 Create a picker control to enable manipulation of plot variables based on a set of fixed choices.
6 }
7  
8 \usage{
9 picker(..., initial = NULL, label = NULL)
10 }
11  
12  
13 \arguments{
14 \item{\dots}{
15 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 \code{\link{as.character}}.
16 }
17 \item{initial}{
18 Initial value for picker. Value must be present in the list of choices specified. If not specified defaults to the first choice.
19 }
20 \item{label}{
21 Display label for picker. Defaults to the variable name if not specified.
22 }
23 }
24  
25 \value{
26 An object of class "manipulator.picker" which can be passed to the \code{\link{manipulate}} function.
27 }
28  
29 \seealso{
30 \code{\link{manipulate}}, \code{\link{slider}}, \code{\link{checkbox}}, \code{\link{button}}
31 }
32  
33  
34 \examples{
35 \dontrun{
36  
37 ## Filtering data with a picker
38 manipulate(
39 barplot(as.matrix(longley[,factor]),
40 beside = TRUE, main = factor),
41 factor = picker("GNP", "Unemployed", "Employed"))
42  
43 ## Create a picker with labels
44 manipulate(
45 plot(pressure, type = type),
46 type = picker("points" = "p", "line" = "l", "step" = "s"))
47  
48 ## Picker with groups
49 manipulate(
50 barplot(as.matrix(mtcars[group,"mpg"]), beside=TRUE),
51 group = picker("Group 1" = 1:11,
52 "Group 2" = 12:22,
53 "Group 3" = 23:32))
54  
55 ## Histogram w/ picker to select type
56 require(lattice)
57 require(stats)
58 manipulate(
59 histogram(~ height | voice.part,
60 data = singer, type = type),
61 type = picker("percent", "count", "density"))
62  
63 }
64 }