-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathui.R
More file actions
executable file
·90 lines (86 loc) · 3.09 KB
/
ui.R
File metadata and controls
executable file
·90 lines (86 loc) · 3.09 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#
# This is the user-interface definition of a Shiny web application. You can
# run the application by clicking 'Run App' above.
#
# Find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com/
#
#Load libraries
library(shiny)
library(leaflet)
library(dygraphs)
vars <-
sort(c(
'Chloride',
"Cadmium",
"Calcium",
"Iron",
"Manganese",
"Magnesium",
"pH",
"Selenium",
"Zinc",
"Specific conductance",
"Sulfur, sulfate (SO4) as SO4",
"Copper",
"Lead",
"Sodium",
"Phosphate-phosphorus as P",
"Inorganic nitrogen (nitrate and nitrite) as N",
"Aluminum"
))
# Define User Interface
shinyUI(fluidPage(sidebarLayout(
sidebarPanel(
p('In this teaching module, you will explore changing water quality in the
Snake River Watershed (near Keystone Ski Area, in red) and Upper Blue River Watershed (near Breckenridge, in blue).
We will look at a 50-year record of concentration of key nutrients, pollutants, and discharge,
to gain a better understanding of the factors (land use, discharge, pH)
that influence water quality in high mountain watersheds. Markers on map show location of WQ monitoring sites.
Code, a lesson summary, and data for this web application can be found at my',
a('Github site',href='https://github.com/matthewross07/WR440.Lesson')
),
leafletOutput('map',height=350) #Sets dimensions of leaflet map
),
mainPanel(
tabsetPanel(
tabPanel('WQ change over time',
fluidRow(column(4,
selectInput('analyte',label='Select a water quality analyte',
choices=vars)),
column(4,
p('Look up drinking water thresholds',
a('Primary',href='https://www.epa.gov/ground-water-and-drinking-water/national-primary-drinking-water-regulations'),
'or',
a('Secondary',href='https://www.epa.gov/dwstandardsregulations/secondary-drinking-water-standards-guidance-nuisance-chemicals')
)
),
column(4,
numericInput('thresh',label='Enter a Regulation Threshold',value=NA))
),
plotOutput('diff',height='160px'),
h4('Analyte Concentration'),
dygraphOutput('time.chem',height='160px'),
h4('Daily Mean Discharge'),
dygraphOutput('q',height='160px')
),
tabPanel('WQ change with flow and season',
fluidRow(column(
4,
selectInput('analyte1',label='Select an analyte',
choices=vars)),
column(4,
selectInput('model',label='Select a model to fit',
choices=c('none','yx','logx','logy','logyx'))),
column(4,
selectInput('season',label='Select a season',
choices=c('all','summer','winter')))),
br(),
h3('Daily Discharge'),
dygraphOutput('q2', height='200px'),
h3('QC plots'),
plotOutput('chemostasis',height='200px')
)
)
))))