-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathserver.R
More file actions
31 lines (27 loc) · 883 Bytes
/
server.R
File metadata and controls
31 lines (27 loc) · 883 Bytes
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
library(datasets)
shinyServer(function(input, output) {
output$Teleplot <- renderPlot({
if (input$variable == 'Region') {
# Render Region barplot
barplot(WorldPhones[,input$region],
main=input$region,
ylab="Number of Telephones (in thousands)",
xlab="Year",
col = "steelblue4",
border = "grey0",
#standardize y axis across all regions
ylim = c(0,80000))
}
else {
#render Year barplot
barplot(WorldPhones[input$year,],
main=input$year,
ylab="Number of Telephones (in thousands)",
xlab="Region",
col = "steelblue4",
border = "grey0",
#standardize y axis across all regions
ylim = c(0,80000))
}
})
})