-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui.R
303 lines (290 loc) · 20.9 KB
/
ui.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
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
library(shiny)
library(plotly)
library(ggplot2)
# Create an interactive web page with a sidebar containing input fields and a main panel containing the results
shinyUI(fluidPage(
# Application title
titlePanel("Climate Indicators"),
tabsetPanel(
# Sidebar with radio buttons for dataset selection and start and end years between 1880 and 2020
tabPanel(
"Global surface temperature",
sidebarLayout(
sidebarPanel(
selectInput("temperature", "Choose a data set:",
list("GISS" = "GISS",
"NOAA" = "NOAA",
"HadCRUT" = "HadCRUT",
"BEST" = "BEST"),
selected = "HadCRUT"),
h5("Enter a year between 1850 and last year"),
h6("Note: HadCRUT and BEST start in 1850, NOAA and GISS in 1880"),
numericInput("startdate", "Start Year", 1880, min = 1850),
numericInput("enddate", "End Year", 2023, min = 1851)
),
# Trend, time series graph with regression line, and regression output.
mainPanel(
h3("Trend per 100 years (ºC)"),
textOutput("trend"),
h5("95% confidence interval (ºC)"),
textOutput("confidence"),
h3("Change in global temperature over time"),
h5("Trend with 95% confidence interval"),
plotlyOutput("tempPlot"),
h3("Regression fit"),
verbatimTextOutput("sum")
)
)
),
tabPanel(
"Global satellite temperature",
sidebarLayout(
sidebarPanel(
selectInput("satellite", "Choose a data set:",
list("RSS" = "RSS",
"UAH" = "UAH"),
selected = "RSS"),
h5("Enter a year between 1979 and last year"),
numericInput("sat_startdate", "Start Year", 1979, min = 1979),
numericInput("sat_enddate", "End Year", 2023, min = 1980)
),
# Trend, time series graph with regression line, and regression output.
mainPanel(
h3("Trend per 100 years (ºC)"),
textOutput("sat_trend"),
h5("95% confidence interval (ºC)"),
textOutput("sat_confidence"),
h3("Change in global temperature over time"),
h5("Trend with 95% confidence interval"),
plotlyOutput("sat_tempPlot"),
h3("Regression fit"),
verbatimTextOutput("sat_sum")
)
)
),
tabPanel(
"Ocean surface temperature",
sidebarLayout(
sidebarPanel(
h5("Enter a year between 1850 and last year"),
numericInput("ocean_startdate", "Start Year", 1850, min = 1850),
numericInput("ocean_enddate", "End Year", 2023, min = 1851)
),
# Trend, time series graph with regression line, and regression output.
mainPanel(
h3("Trend per 100 years (ºC)"),
textOutput("ocean_trend"),
h5("95% confidence interval (ºC)"),
textOutput("ocean_confidence"),
h3("Change in ocean temperature over time"),
h5("Trend with 95% confidence interval"),
plotlyOutput("ocean_tempPlot"),
h3("Regression fit"),
verbatimTextOutput("ocean_sum")
)
)
),
tabPanel(
"Solar Activity",
sidebarLayout(
sidebarPanel(
selectInput("solar_data", "Choose a data set:",
list("Sunspots" = "sunspots",
"Solar irradiance" = "irradiance"),
selected = "irradiance"),
h5("Enter a year between 1850 and last year"),
numericInput("sun_startdate", "Start Year", 1850, min = 1750),
numericInput("sun_enddate", "End Year", 2023, min = 1751)
),
#Trend, time series graph, and regression output
mainPanel(
h3("Change in solar output per 100 years"),
textOutput("sun_trend"),
h5("95% confidence interval"),
textOutput("sun_confidence"),
h3("Change in solar output over time"),
h5("Trend with 95% confidence interval"),
plotlyOutput("sun_plot"),
h3("Regression fit"),
verbatimTextOutput("sun_sum")
)
)
),
tabPanel(
HTML(paste0("CO",tags$sub("2"))),
sidebarLayout(
sidebarPanel(
h5("Enter a year between 1959 and last year"),
numericInput("CO2_startdate", "Start Year", 1959, min = 1959),
numericInput("CO2_enddate", "End Year", 2023, min = 1960)
),
#Trend, time series graph, and regression output
mainPanel(
h3(HTML(paste0("Linear change in atmospheric CO",tags$sub("2"), " levels per decade (ppm)"))),
textOutput("CO2_trend"),
h5("95% confidence interval (ppm)"),
textOutput("CO2_confidence"),
h3(HTML(paste0("Change in atmospheric CO",tags$sub("2"), " levels over time"))),
h5("Trend with 95% confidence interval"),
plotlyOutput("CO2_plot"),
h3("Regression fit"),
verbatimTextOutput("CO2_sum")
)
)
),
tabPanel(
"El Niño/Southern Oscillation",
sidebarLayout(
sidebarPanel(
h5("Enter a year between 1950 and last year"),
numericInput("ENSO_startdate", "Start Year", 1950, min = 1950),
numericInput("ENSO_enddate", "End Year", 2023, min = 1951)
),
#Trend, time series graph, and regression output
mainPanel(
h3("Change in ENSO 3.4 area temperature anomalies per decade (ºC)"),
textOutput("ENSO_trend"),
h5("95% confidence interval (ºC)"),
textOutput("ENSO_confidence"),
h3("Change in ENSO temperature anomalies over time"),
h5("Loess trend with 95% confidence interval"),
plotlyOutput("ENSO_plot"),
h3("Regression fit"),
verbatimTextOutput("ENSO_sum")
)
)
),
tabPanel(
"Sea Ice Extent",
sidebarLayout(
sidebarPanel(
h5("Pick a data set"),
selectInput("sea_ice_data", "Select data", choices = c("Arctic",
"Antarctic")
),
h5("Enter a year between 1979 and last year"),
numericInput("sea_ice_startdate", "Start Year", 1979, min = 1979),
numericInput("sea_ice_enddate", "End Year", 2023, min = 1980),
h5("Select a month"),
selectInput("sea_ice_month_choice", "Select month", choices = c("All",
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December")
)
),
mainPanel(
h3("Change in sea ice extent per decade (square kilometers)"),
textOutput("sea_ice_trend"),
h5("95% confidence interval (square kilometers)"),
textOutput("sea_ice_confidence"),
h3("Change in sea ice extent over time"),
h5("Loess trend with 95% confidence interval"),
plotlyOutput("sea_ice_plot"),
h3("Linear Regression fit"),
verbatimTextOutput("sea_ice_sum")
)
)
),
tabPanel(
"FAQ",
sidebarLayout(
sidebarPanel = NULL,
mainPanel(
h4("Question: Where are you getting the data?"),
"GISS:",
a(href = "https://data.giss.nasa.gov/gistemp/tabledata_v4/GLB.Ts+dSST.txt", "https://data.giss.nasa.gov/gistemp/tabledata_v4/GLB.Ts+dSST.txt"),
br(),
br(),
"NOAA:",
a(href = "https://www.ncei.noaa.gov/access/monitoring/global-temperature-anomalies/anomalies", "https://www.ncei.noaa.gov/access/monitoring/global-temperature-anomalies/anomalies"),
br(),
br(),
"HadCRUT5:",
a(href = "https://www.metoffice.gov.uk/hadobs/hadcrut5/data/current/download.html", "https://www.metoffice.gov.uk/hadobs/hadcrut5/data/current/download.html"),
br(),
br(),
"BEST:",
a(href = "https://berkeley-earth-temperature.s3.us-west-1.amazonaws.com/Global/Land_and_Ocean_complete.txt", "https://berkeley-earth-temperature.s3.us-west-1.amazonaws.com/Global/Land_and_Ocean_complete.txt"),
br(),
br(),
"RSS TLT:",
a(href = "https://images.remss.com/msu/graphics/TLT_v40/time_series/RSS_TS_channel_TLT_Global_Land_And_Sea_v04_0.txt", "https://images.remss.com/msu/graphics/TLT_v40/time_series/RSS_TS_channel_TLT_Global_Land_And_Sea_v04_0.txt"),
br(),
br(),
"UAH:",
a(href = "https://www.nsstc.uah.edu/data/msu/v6.0/tlt/uahncdc_lt_6.0.txt", "https://www.nsstc.uah.edu/data/msu/v6.0/tlt/uahncdc_lt_6.0.txt"),
br(),
br(),
"Ocean temperatures (HadSST):",
a(href = "https://www.metoffice.gov.uk/hadobs/hadsst4/data/csv/HadSST.4.0.1.0_annual_GLOBE.csv", "https://www.metoffice.gov.uk/hadobs/hadsst4/data/csv/HadSST.4.0.1.0_annual_GLOBE.csv"),
br(),
br(),
"Sunspots:",
a(href = "https://www.sidc.be/silso/DATA/SN_y_tot_V2.0.txt", "https://www.sidc.be/silso/DATA/SN_y_tot_V2.0.txt"),
br(),
br(),
"Solar irradiance:",
a(href = "https://www2.mps.mpg.de/projects/sun-climate/data/SATIRE-T_SATIRE-S_TSI_1850_20220923.txt", "https://www2.mps.mpg.de/projects/sun-climate/data/SATIRE-T_SATIRE-S_TSI_1850_20220923.txt"),
br(),
br(),
"CO2:",
a(href = "https://gml.noaa.gov/webdata/ccgg/trends/co2/co2_annmean_mlo.txt", "https://gml.noaa.gov/webdata/ccgg/trends/co2/co2_annmean_mlo.txt"),
br(),
br(),
"El Niño/Southern Oscillation:",
a(href = "https://www.cpc.ncep.noaa.gov/data/indices/oni.ascii.txt", "https://www.cpc.ncep.noaa.gov/data/indices/oni.ascii.txt"),
br(),
br(),
"Arctic Sea Ice:",
a(href = "https://psl.noaa.gov/data/timeseries/monthly/data/n_iceextent.mon.data", "https://psl.noaa.gov/data/timeseries/monthly/data/n_iceextent.mon.data"),
br(),
br(),
"Antarctic Sea Ice:",
a(href = "https://psl.noaa.gov/data/timeseries/monthly/data/s_iceextent.mon.data", "https://psl.noaa.gov/data/timeseries/monthly/data/s_iceextent.mon.data"),
br(),
h4("Question: I've heard that the temperature data are fudged, that there's really no warming."),
p("Answer: This one has been answered so many times, we're flogging a dead horse at this point. Yes, scientists make adjustments to the data. No, they're not fudging the data. Those adjustments are to make the data more accurate."),
br(),
p("Think of it like this: I buy a new computerized thermostat for my house that shows consistently 2º higher than my old thermostat. If I want to compare the temperature data for my house between the old thermostat and the new, what should I do? Should I compare the raw data without adjusting for the difference between the two thermostats? Or should I add 2º to the old data (or substract 2º from the new) first?"),
br(),
p("I'm sure you'll agree that I should first adjust my data to get an accurate comparison. That's the same thing NOAA, NASA, and the Hadley Center do on a much larger scale. If you want to know precisely what they do and why, Carbon Brief has a nice rundown on the adjustments those agencies make and why:"),
a(href = "https://www.carbonbrief.org/explainer-how-data-adjustments-affect-global-temperature-records/", "https://www.carbonbrief.org/explainer-how-data-adjustments-affect-global-temperature-records/"),
br(),
br(),
HTML("But no, those adjustments don't create global warming from nothing. In fact, the adjustments actually make the temperature data show <i>less</i> global warming."),
br(),
h4("Question: Isn't this all part of a natural cycle?"),
p("Answer: No. None of the natural cycles we currently know could explain the current warming trend. First, it's happening much faster than any natural cycle could cause. Second, all of the cycles we have discovered so far are either neutral or cooling."),
p("The sun? Cooling since the 1950s, as you can verify yourselves with the Solar Activity tab."),
p("Milankovic cycles? Warming due to Milankovic cycles peaked 6,000 years ago and has been cooling since. If it were up to Milankovic cycles, we'd still be cooling down to the next ice age. Also take centuries to change the average global temperature by 1ºC."),
p("El Niño? No discernable trend and also has the wrong period, again as you can verify yourself with the ENSO tab. While El Niño explains some of the wiggles around the trend, it does not match the trend itself."),
p("Pacific Decadal Oscillation? Again, doesn't match the trend. Beyond not matching the trend, if ocean cycles were causing global warming, we'd expect ocean temperatures to cool as the atmosphere warmed. That hasn't happened."),
p("Cosmic rays? Cosmic rays create C-14 in the atmosphere. If it was cosmic rays, we'd see more C-14 being created. That hasn't happened."),
HTML("The planet been both warmer and cooler than today. However, just because what happened in the past was natural does not mean that what is happening today is also natural. Change happens because something is <i>causing</i> that change. If you truly believe that global warming is due to a natural cycle, the burden of proof is on <b>you</b> to identify that cycle and show that it is causing the current warming trend. So, which cycle is it and where's your evidence?")
)
)
)
),
hr(),
h5("Created by: Jim Milks"),
"Version 4",
br(),
"Updated: 14 July 2023",
br(),
a(actionButton(inputId = "email1", label = "Contact Admin",
icon = icon("envelope", lib = "font-awesome")),
href = "mailto: jrmilks@gmail.com"),
br(),
"Code available at:",
a(href = "https://github.com/jrmilks74/global-temperature-trend-calculator/tree/main", "https://github.com/jrmilks74/global-temperature-trend-calculator/tree/main")
)
)