-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.R
44 lines (34 loc) · 1.27 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# This is the server logic for a Shiny web application.
# You can find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com
#
shinyServer(function(input, output)
{
output$selected_var <- renderText({
paste('Viewing water quality data at',input$site, 'between', input$dates[1],
'and', input$dates[2])
})
output$chlplot <- renderPlot({
plotdata<- subset(greenriverdata,site_name==input$site &
dateTime >= input$dates[1] &
dateTime<= input$dates[2])
ggplot(data=plotdata,aes(x=plotdata$dateTime,y=plotdata[,input$param]))+geom_point()
})
output$sitemap <- renderLeaflet({
labels= c("Green River", "Red Butte Creek")
longs= c(-109.2375, -111.8052)
lats= c(40.4094, 40.78)
leaflet() %>%
addTiles() %>%
addMarkers(lng=longs, lat=lats, popup = labels)
})
mod <- reactive({
plotdata <- subset(greenriverdata,SiteName==input$site &
dateTime >= input$dates[1] &
dateTime<= input$dates[2])
mod <- lm(plotdata$dateTime~plotdata[,input$param])
modsummary <- summary(mod)
return(modsummary)
})
})