-
Notifications
You must be signed in to change notification settings - Fork 18
/
plotinputs.R
56 lines (47 loc) · 1.51 KB
/
plotinputs.R
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# plotinputs adds some (reactive) UI to each plot
selectFactors = function(dataSet,fields) {
Reduce(tagAppendChild,
Map(
function(field)selectInput(field,field,choices=c("All",levels(dataSet[[field]])),selected=input[[field]]),
fields
),
tags$span())
}
diamonds_plotinput = function(...) {
selectFactors(diamonds, c("clarity","cut","color"))
}
french_fries_plotinput = function(...) {
tagList(
selectInput("rep","Experiment Replicate Number",choices=unique(french_fries$rep))
)
}
msleep_plotinput = function(...) {
tagList(
selectInput("order","Order",choices=c("All",unique(msleep$order)),selected=input$order),
selectInput("genus","Genus",choices=c("All",unique(subset(msleep,order==input$order)$genus)))
)
}
mpg_plotinput = function(...) {
tagList(
selectInput("manufacturer","manufacturer",choices=c("All",levels(mpg$manufacturer)),selected=input$manufacturer),
selectInput("model","Model",choices=c("All",levels(droplevels(subset(mpg,manufacturer==input$manufacturer)$model))))
)
}
AirPassengers_plotinput = function(...) {
tagList(
textInput("month1","From",value=1),
textInput("month2","To",value=12)
)
}
sunspots_plotinput = function(...) {
tagList(
textInput("startDate","start date","-6974006400000"),
textInput("endDate","end date","439113600000")
)
}
iris_plotinput = function(dataName) {
tagList(
sliderInput("breaks", "Histogram Breaks:",
min = 6, max = 30, value = 8, step= 2)
)
}