-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.R
28 lines (25 loc) · 1.06 KB
/
server.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
library(shiny)
shinyServer(
function(input, output) {
output$graph <- renderPlot({
proper <- switch(input$property,
"Conductivity" = chemFinal$Conductivity,
"Dissolved Oxygen (mg/L)" = chemFinal$DO..mg.L.,
"Dissolved Oxygen (%)" = chemFinal$DO....,
"pH" = chemFinal$pH, "skyblue",
"Turbidity (NTU)" = chemFinal$Turbidity..NTU.,
"Alkalinity (mg/L)" = chemFinal$Alkalinity..mg.L.
)
colored <- switch(input$property,
"Conductivity" = "orange",
"Dissolved Oxygen (mg/L)" = "green",
"Dissolved Oxygen (%)" = "darkgreen",
"pH" = "blue",
"Turbidity (NTU)" = "gray",
"Alkalinity (mg/L)" = "purple"
)
ggplot(chemFinal, aes(Location, proper)) + geom_bar(stat="identity", fill=colored) +
xlab("Location") + ylab(input$property)
})
}
)