-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.R
More file actions
577 lines (480 loc) · 32.8 KB
/
app.R
File metadata and controls
577 lines (480 loc) · 32.8 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
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
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
library(shiny)
library(tidyverse)
library(shinythemes)
library(racecar)
library(plotly)
###requires racecar package
ui <- fluidPage(theme = shinytheme("cyborg"),
####CSS CODE TO FORMAT THE TWO TAB NAVIGATION BAR
tags$style(type = 'text/css', '.navbar { background-color:black;
font-family: Arial;
font-size: 13px;
color:black; }',
'.navbar-default .navbar-brand {
color:red;
}',
####CSS CODE TO SUPRESS INITIAL WARNING ERRORS WHEN DATA IS NOT UPLOADED
".shiny-output-error { visibility: hidden; }",
".shiny-output-error:before { visibility: hidden; }"),
navbarPage("raceR",
tabPanel("About", fluidRow(column(width = 4,
tags$img(src = "logo.jpg")),
column(width = 6,
tags$h1("raceR", style = "color:red;"))),
fluidRow(column(width = 12,
tags$h3("Welcome to raceR!"),
tags$h5("raceR creates visualizations of telemetry data."),
tags$h5("Choose the 'Single' tab if you are interested in looking at data for a single lap by a
single driver and do not want to compare it to other data."),
tags$h5("Choose the 'Compare' tab if you are interested in comparing lap data among 2 different
drivers, comparing 2 laps completed by the same driver, or looking at different variables for the
same lap."),
tags$h5("raceR is designed to be used with telemetry data from the Brown Formula Racing Team."),
tags$h5("This app provides users multiple ways to look at data."),
tags$h5("Under the 'SINGLE' tab you can look at graphs from a single .csv file"),
tags$img(src = "one.png", style = "height:35; width:35"),
tags$h5("After uploading a .csv file exported from racestudio2, you may choose between a variety of different graphs"),
tags$img(src = "two.png"),
tags$h5("You can choose which part of the track you want your graph to show"),
tags$img(src = "three.png"),
tags$h5("You can also hover on any point of the graph to see the exact value at that point."),
tags$img(src = "four.png", style = "height:35; width:35"),
tags$h5("The 'COMPARE' tab provides all the same functionality as the 'SINGLE' tab, but allows users to compare the same plots among different drivers,
the same plots among the same driver driving different laps, or different plots from the same data set"),
tags$img(src = "five.png"),
tags$h5("Below is an example of comparing the speed around the track for the same driver on 2 different laps"),
tags$img(src = "six.png")))),
######### tab for looking at one set of data - for one driver or one lap #########
tabPanel("Single", fluidRow(column(width = 4,
tags$img(src = "logo.jpg")),
column(width = 6,
tags$h1("raceR", style = "color:red;"))),
######## csv upload box for single data tab
fluidRow(column(width = 12,
fileInput("upload1", label = h4("Upload .csv here")))),
######## graph choice drop down for single data tab
fluidRow(column(width = 12, selectInput("graphtype1", label = h5("Choose Graph"),
choices = list("Braking Map" = "braking", "Throttle Position Map" = "throttle",
"Graph of Lap Speed" = "laps", "Map of Lap RPM" = "maprpm",
"Map of Lap Speed" = "mapspeed", "Air to Fuel Ratio vs RPM" = "airfuel",
"Oil Pressure Map" = "oilpressure"),
selected = "mapspeed"))),
######## distance slider for single data tab
fluidRow(column(width = 12,
sliderInput("distrange1", label = h5("Select Distance"),
min = 0,
max = 3.5, value = c(0, 3.5)))),
fluidRow(column(width = 12, textOutput("text1"))),
######## graphical output for single data tab
fluidRow(column(width = 12, height = "auto",
plotlyOutput("graph1")),
######## test output for the point on the graph
verbatimTextOutput("event")),
######## summary statistics output for single data tab
fluidRow(column(width = 12,
tableOutput("table1")))),
######### tab for looking at two sets of data - compare two drivers or compare two laps of the same driver #########
tabPanel("Compare",
fluidRow(column(width = 6,
tags$img(src = "logo.jpg")),
column(width = 6,
tags$h1("raceR", style = "color:red;"))),
######## left csv upload box for compare data tab
fluidRow(column(width = 6,
fileInput("upload2", label = h4("Upload .csv here"))),
######## right csv upload box for compare data tab
column(width = 6,
fileInput("upload3", label = h4("Upload .csv here")))),
######## left graph choice drop down for compare data tab
fluidRow(column(width = 4,
selectInput("graphtype2", label = h5("Choose Graph"),
choices = list("Braking Map" = "braking", "Throttle Position Map" = "throttle",
"Graph of Lap Speed" = "laps", "Map of Lap RPM" = "maprpm",
"Map of Lap Speed" = "mapspeed", "Air to Fuel Ratio vs RPM" = "airfuel",
"Oil Pressure Map" = "oilpressure"),
selected = "mapspeed")),
######## distance slider for compare data tab
column(width = 4,
sliderInput("distrange2", label = h5("Select Distance"),
min = 0,
max = 3.5, value = c(0, 3.5))),
######## right graph choice drop down for compare data tab
column(width = 4,
selectInput("graphtype3", label = h5("Choose Graph"),
choices = list("Braking Map" = "braking", "Throttle Position Map" = "throttle",
"Graph of Lap Speed" = "laps", "Map of Lap RPM" = "maprpm",
"Map of Lap Speed" = "mapspeed", "Air to Fuel Ratio vs RPM" = "airfuel",
"Oil Pressure Map" = "oilpressure"),
selected = "mapspeed"))),
fluidRow(column(width = 6,
textOutput("text2")),
column(width = 6,
textOutput("text3"))),
######## left graphical output for compare data tab
fluidRow(column(width = 6, height = "400px",
plotlyOutput("graph2")),
######## right graphical output for compare data tab
column(width = 6, height = "400px",
plotlyOutput("graph3"))),
######## left summary statistics output for compare data tab
fluidRow(column(width = 6,
tableOutput("table2")),
######## right summary statistics output for compare data tab
column(width = 6,
tableOutput("table3"))))))
server <- function(input, output) {
options(shiny.maxRequestSize = 50*1024^2)
##create plot for single data tab based on user input from dropdown menu
output$graph1 <- renderPlotly( {
input_data <- cleanSingleLap(input$upload1$datapath, 1)
if(input$graphtype1 %in% c("laps")) {
lapspeed(input_data, 1, startdist = input$distrange1[1], enddist = input$distrange1[2]) + theme(
strip.background = element_blank(),
strip.text.x = element_blank()
)
} else if (input$graphtype1 %in% c("mapspeed")) {
mapspeed(input_data, 1, startdist = input$distrange1[1], enddist = input$distrange1[2]) + theme(
strip.background = element_blank(),
strip.text.x = element_blank()
)
} else if (input$graphtype1 %in% c("maprpm")) {
maprpm(input_data, 1, startdist = input$distrange1[1], enddist = input$distrange1[2]) + theme(
strip.background = element_blank(),
strip.text.x = element_blank()
)
} else if (input$graphtype1 %in% c("throttle")) {
throttle_position(input_data, 1, startdist = input$distrange1[1], enddist = input$distrange1[2]) + theme(
strip.background = element_blank(),
strip.text.x = element_blank()
)
} else if (input$graphtype1 %in% c("braking")) {
braking_pattern(input_data, 1, startdist = input$distrange1[1], enddist = input$distrange1[2]) + theme(
strip.background = element_blank(),
strip.text.x = element_blank()
)
} else if (input$graphtype1 %in% c("airfuel")) {
airfuel(input_data, 1, startdist = input$distrange1[1], enddist = input$distrange1[2]) + theme(
strip.background = element_blank(),
strip.text.x = element_blank()
)
} else if (input$graphtype1 %in% c("oilpressure")) {
oilpressure(input_data, 1, startdist = input$distrange1[1], enddist = input$distrange1[2]) + theme(
strip.background = element_blank(),
strip.text.x = element_blank()
)
}
})
output$event <- renderPrint({
d <- event_data("plotly_hover")
if (is.null(d)) "Hover on a point!" else d
})
##create left plot for compare data tab based on user input from dropdown menu
output$graph2 <- renderPlotly({
input_data <- cleanSingleLap(input$upload2$datapath, 1)
if(input$graphtype2 %in% c("laps")) {
lapspeed(input_data, 1, startdist = input$distrange2[1], enddist = input$distrange2[2]) + theme(
strip.background = element_blank(),
strip.text.x = element_blank()
)
} else if (input$graphtype2 %in% c("mapspeed")) {
mapspeed(input_data, 1, startdist = input$distrange2[1], enddist = input$distrange2[2]) + theme(
strip.background = element_blank(),
strip.text.x = element_blank()
)
} else if (input$graphtype2 %in% c("maprpm")) {
maprpm(input_data, 1, startdist = input$distrange2[1], enddist = input$distrange2[2]) + theme(
strip.background = element_blank(),
strip.text.x = element_blank()
)
} else if (input$graphtype2 %in% c("throttle")) {
throttle_position(input_data, 1, startdist = input$distrange2[1], enddist = input$distrange2[2]) + theme(
strip.background = element_blank(),
strip.text.x = element_blank()
)
} else if (input$graphtype2 %in% c("braking")) {
braking_pattern(input_data, 1, startdist = input$distrange2[1], enddist = input$distrange2[2]) + theme(
strip.background = element_blank(),
strip.text.x = element_blank()
)
} else if (input$graphtype2 %in% c("airfuel")) {
airfuel(input_data, 1, startdist = input$distrange2[1], enddist = input$distrange2[2]) + theme(
strip.background = element_blank(),
strip.text.x = element_blank()
)
} else if (input$graphtype2 %in% c("oilpressure")) {
oilpressure(input_data, 1, startdist = input$distrange2[1], enddist = input$distrange2[2]) + theme(
strip.background = element_blank(),
strip.text.x = element_blank()
)
}
})
##create right plot for compare data tab based on user input from dropdown menu
output$graph3 <- renderPlotly({
input_data <- cleanSingleLap(input$upload3$datapath, 1)
if(input$graphtype3 %in% c("laps")) {
lapspeed(input_data, 1, startdist = input$distrange2[1], enddist = input$distrange2[2]) + theme(
strip.background = element_blank(),
strip.text.x = element_blank()
)
} else if (input$graphtype3 %in% c("mapspeed")) {
mapspeed(input_data, 1, startdist = input$distrange2[1], enddist = input$distrange2[2]) + theme(
strip.background = element_blank(),
strip.text.x = element_blank()
)
} else if (input$graphtype3 %in% c("maprpm")) {
maprpm(input_data, 1, startdist = input$distrange2[1], enddist = input$distrange2[2]) + theme(
strip.background = element_blank(),
strip.text.x = element_blank()
)
} else if (input$graphtype3 %in% c("throttle")) {
throttle_position(input_data, 1, startdist = input$distrange2[1], enddist = input$distrange2[2]) + theme(
strip.background = element_blank(),
strip.text.x = element_blank()
)
} else if (input$graphtype3 %in% c("braking")) {
braking_pattern(input_data, 1, startdist = input$distrange2[1], enddist = input$distrange2[2]) + theme(
strip.background = element_blank(),
strip.text.x = element_blank()
)
} else if (input$graphtype3 %in% c("airfuel")) {
airfuel(input_data, 1, startdist = input$distrange2[1], enddist = input$distrange2[2]) + theme(
strip.background = element_blank(),
strip.text.x = element_blank()
)
} else if (input$graphtype3 %in% c("oilpressure")) {
oilpressure(input_data, 1, startdist = input$distrange2[1], enddist = input$distrange2[2]) + theme(
strip.background = element_blank(),
strip.text.x = element_blank()
)
}
})
##create summary statistics table for single data tab
output$table1 <- renderTable( {
input_data <- cleanSingleLap(input$upload1$datapath, 1)
if(input$graphtype1 %in% c("laps")) {
input_data %>%
filter(Distance >= input$distrange1[1]) %>%
filter(Distance <= input$distrange1[2]) %>%
group_by(Lap) %>%
summarise(Ave_Speed = mean(GPS_Speed), Sd_Speed = sd(GPS_Speed))
} else if (input$graphtype1 %in% c("mapspeed")) {
input_data %>%
filter(Distance >= input$distrange1[1]) %>%
filter(Distance <= input$distrange1[2]) %>%
summarise(Ave_Speed = mean(GPS_Speed), Sd_Speed = sd(GPS_Speed))
} else if (input$graphtype1 %in% c("maprpm")) {
input_data %>%
filter(Distance >= input$distrange1[1]) %>%
filter(Distance <= input$distrange1[2]) %>%
summarise(Ave_RPM = mean(PE3_RPM), Sd_RPM = sd(PE3_RPM))
} else if (input$graphtype1 %in% c("throttle")) {
input_data %>%
filter(Distance >= input$distrange1[1]) %>%
filter(Distance <= input$distrange1[2]) %>%
summarise(Ave_Throttle = mean(PE3_TPS), Sd_Throttle = sd(PE3_TPS))
} else if (input$graphtype1 %in% c("braking")) {
input_data %>%
filter(Distance >= input$distrange1[1]) %>%
filter(Distance <= input$distrange1[2]) %>%
summarise(Ave_Break = mean(BPS_Front), Sd_Break = sd(BPS_Front))
} else if (input$graphtype1 %in% c("airfuel")) {
input_data %>%
filter(Distance >= input$distrange1[1]) %>%
filter(Distance <= input$distrange1[2]) %>%
summarise(Ave_Ratio = mean(PE3_LAMBDA), Sd_Ratio = sd(PE3_LAMBDA))
} else if (input$graphtype1 %in% c("oilpressure")) {
input_data %>%
filter(Distance >= input$distrange1[1]) %>%
filter(Distance <= input$distrange1[2]) %>%
summarise(Ave_Lat_Accel = mean(GPS_LatAcc), Sd_Lat_Accel = sd(GPS_LonAcc))
}
})
##create left summary statistics table for compare data tab
output$table2 <- renderTable( {
input_data <- cleanSingleLap(input$upload2$datapath, 1)
if(input$graphtype2 %in% c("laps")) {
input_data %>%
filter(Distance >= input$distrange2[1]) %>%
filter(Distance <= input$distrange2[2]) %>%
group_by(Lap) %>%
summarise(Ave_Speed = mean(GPS_Speed), Sd_Speed = sd(GPS_Speed))
} else if (input$graphtype2 %in% c("mapspeed")) {
input_data %>%
filter(Distance >= input$distrange2[1]) %>%
filter(Distance <= input$distrange2[2]) %>%
summarise(Ave_Speed = mean(GPS_Speed), Sd_Speed = sd(GPS_Speed))
} else if (input$graphtype2 %in% c("maprpm")) {
input_data %>%
filter(Distance >= input$distrange2[1]) %>%
filter(Distance <= input$distrange2[2]) %>%
summarise(Ave_RPM = mean(PE3_RPM), Sd_RPM = sd(PE3_RPM))
} else if (input$graphtype2 %in% c("throttle")) {
input_data %>%
filter(Distance >= input$distrange2[1]) %>%
filter(Distance <= input$distrange2[2]) %>%
summarise(Ave_Throttle = mean(PE3_TPS), Sd_Throttle = sd(PE3_TPS))
} else if (input$graphtype2 %in% c("braking")) {
input_data %>%
filter(Distance >= input$distrange2[1]) %>%
filter(Distance <= input$distrange2[2]) %>%
summarise(Ave_Break = mean(BPS_Front), Sd_Break = sd(BPS_Front))
} else if (input$graphtype2 %in% c("airfuel")) {
input_data %>%
filter(Distance >= input$distrange2[1]) %>%
filter(Distance <= input$distrange2[2]) %>%
summarise(Ave_Ratio = mean(PE3_LAMBDA), Sd_Ratio = sd(PE3_LAMBDA))
} else if (input$graphtype2 %in% c("oilpressure")) {
input_data %>%
filter(Distance >= input$distrange2[1]) %>%
filter(Distance <= input$distrange2[2]) %>%
summarise(Ave_Lat_Accel = mean(GPS_LatAcc), Sd_Lat_Accel = sd(GPS_LonAcc))
}
})
##create right summary statistics table for compare data tab
output$table3 <- renderTable( {
input_data <- cleanSingleLap(input$upload3$datapath, 1)
if(input$graphtype3 %in% c("laps")) {
input_data %>%
filter(Distance >= input$distrange2[1]) %>%
filter(Distance <= input$distrange2[2]) %>%
group_by(Lap) %>%
summarise(Ave_Speed = mean(GPS_Speed), Sd_Speed = sd(GPS_Speed))
} else if (input$graphtype3 %in% c("mapspeed")) {
input_data %>%
filter(Distance >= input$distrange2[1]) %>%
filter(Distance <= input$distrange2[2]) %>%
summarise(Ave_Speed = mean(GPS_Speed), Sd_Speed = sd(GPS_Speed))
} else if (input$graphtype3 %in% c("maprpm")) {
input_data %>%
filter(Distance >= input$distrange2[1]) %>%
filter(Distance <= input$distrange2[2]) %>%
summarise(Ave_RPM = mean(PE3_RPM), Sd_RPM = sd(PE3_RPM))
} else if (input$graphtype3 %in% c("throttle")) {
input_data %>%
filter(Distance >= input$distrange2[1]) %>%
filter(Distance <= input$distrange2[2]) %>%
summarise(Ave_Throttle = mean(PE3_TPS), Sd_Throttle = sd(PE3_TPS))
} else if (input$graphtype3 %in% c("braking")) {
input_data %>%
filter(Distance >= input$distrange2[1]) %>%
filter(Distance <= input$distrange2[2]) %>%
summarise(Ave_Break = mean(BPS_Front), Sd_Break = sd(BPS_Front))
} else if (input$graphtype3 %in% c("airfuel")) {
input_data %>%
filter(Distance >= input$distrange2[1]) %>%
filter(Distance <= input$distrange2[2]) %>%
summarise(Ave_Ratio = mean(PE3_LAMBDA), Sd_Ratio = sd(PE3_LAMBDA))
} else if (input$graphtype3 %in% c("oilpressure")) {
input_data %>%
filter(Distance >= input$distrange2[1]) %>%
filter(Distance <= input$distrange2[2]) %>%
summarise(Ave_Lat_Accel = mean(GPS_LatAcc), Sd_Lat_Accel = sd(GPS_LonAcc))
}
})
output$text1 <- renderText({
if(input$graphtype1 %in% c("laps")) {
print("This plot displays the speed change over the distance of a single lap. This plot uses a rainbow color
scheme as a heat map to show changes in speed. Dark Red is the slowest speed and pale yellow is the fastest. This
graph is most useful for looking at how long it takes to complete a given section of the track.")
} else if (input$graphtype1 %in% c("mapspeed")) {
print("This plot displays a map of the track by plotting the longitude and latitude points of the car
on the x and y axes. The speed is recorded and displayed in miles per hour. This map uses a heat mapping to show
the change in speed as the driver drives around the track. Dark red is the slowest speed and pale yellow
is the fastest.")
} else if (input$graphtype1 %in% c("maprpm")) {
print("This plot displays a map of the track by plotting the longitude and latitude points of the car
on the x and y axes. The RPM is recorded and displayed as engine revolutions per minute. This map
uses a heat mapping to show the change in RPM as the driver drives around the track. Dark red
is the slowest RPM and pale yellow is the fastest.")
} else if (input$graphtype1 %in% c("throttle")) {
print("This plot displays a map of the track by plotting the longitude and latitude points of the car
on the x and y axes. The throttle pressure is recorded and displayed as a percentage of full throttle. This map
uses a heat mapping to show the change in throttle pressure as the driver drives around the track. Dark red
is the lowest throttle pressure and pale yellow is the highest.")
} else if (input$graphtype1 %in% c("braking")) {
print("This plot displays a map of the track by plotting the longitude and latitude points of the car
on the x and y axes. The brake pressure is recorded and displayed as pounds per square inch. This map
uses a heat mapping to show the change in brake pressure as the driver drives around the track. Dark red
is the lowest brake pressure and pale yellow is the highest.")
} else if (input$graphtype1 %in% c("airfuel")) {
print("This plot displays engine RPM on the x-axis and the ratio of air to fuel in the exhaust on the y-axis.
The line shows the linear trend of the relationship between these two variables as RPM increases.")
} else if (input$graphtype1 %in% c("oilpressure")) {
print("This plot displays a map of the track by plotting the longitude and latitude points of the car
on the x and y axes. The oil pressure is recorded and displayed as pounds per square inch. This map
uses a heat mapping to show the change in oil pressure as the driver drives around the track. Dark red
is the lowest oil pressure and pale yellow is the highest.")
}
})
output$text2 <- renderText({
if(input$graphtype2 %in% c("laps")) {
print("This plot displays the speed change over the distance of a single lap. This plot uses a rainbow color
scheme as a heat map to show changes in speed. Dark Red is the slowest speed and pale yellow is the fastest. This
graph is most useful for looking at how long it takes to complete a given section of the track.")
} else if (input$graphtype2 %in% c("mapspeed")) {
print("This plot displays a map of the track by plotting the longitude and latitude points of the car
on the x and y axes. The speed is recorded and displayed in miles per hour. This map uses a heat mapping to show
the change in speed as the driver drives around the track. Dark red is the slowest speed and pale yellow
is the fastest.")
} else if (input$graphtype2 %in% c("maprpm")) {
print("This plot displays a map of the track by plotting the longitude and latitude points of the car
on the x and y axes. The RPM is recorded and displayed as engine revolutions per minute. This map
uses a heat mapping to show the change in RPM as the driver drives around the track. Dark red
is the slowest RPM and pale yellow is the fastest.")
} else if (input$graphtype2 %in% c("throttle")) {
print("This plot displays a map of the track by plotting the longitude and latitude points of the car
on the x and y axes. The throttle pressure is recorded and displayed as a percentage of full throttle. This map
uses a heat mapping to show the change in throttle pressure as the driver drives around the track. Dark red
is the lowest throttle pressure and pale yellow is the highest.")
} else if (input$graphtype2 %in% c("braking")) {
print("This plot displays a map of the track by plotting the longitude and latitude points of the car
on the x and y axes. The brake pressure is recorded and displayed as pounds per square inch. This map
uses a heat mapping to show the change in brake pressure as the driver drives around the track. Dark red
is the lowest brake pressure and pale yellow is the highest.")
} else if (input$graphtype2 %in% c("airfuel")) {
print("This plot displays engine RPM on the x-axis and the ratio of air to fuel in the exhaust on the y-axis.
The line shows the linear trend of the relationship between these two variables as RPM increases.")
} else if (input$graphtype2 %in% c("oilpressure")) {
print("This plot displays a map of the track by plotting the longitude and latitude points of the car
on the x and y axes. The oil pressure is recorded and displayed as pounds per square inch. This map
uses a heat mapping to show the change in oil pressure as the driver drives around the track. Dark red
is the lowest oil pressure and pale yellow is the highest.")
}
})
output$text3 <- renderText({
if(input$graphtype3 %in% c("laps")) {
print("This plot displays the speed change over the distance of a single lap. This plot uses a rainbow color
scheme as a heat map to show changes in speed. Dark Red is the slowest speed and pale yellow is the fastest. This
graph is most useful for looking at how long it takes to complete a given section of the track.")
} else if (input$graphtype3 %in% c("mapspeed")) {
print("This plot displays a map of the track by plotting the longitude and latitude points of the car
on the x and y axes. The speed is recorded and displayed in miles per hour. This map uses a heat mapping to show
the change in speed as the driver drives around the track. Dark red is the slowest speed and pale yellow
is the fastest.")
} else if (input$graphtype3 %in% c("maprpm")) {
print("This plot displays a map of the track by plotting the longitude and latitude points of the car
on the x and y axes. The RPM is recorded and displayed as engine revolutions per minute. This map
uses a heat mapping to show the change in RPM as the driver drives around the track. Dark red
is the slowest RPM and pale yellow is the fastest.")
} else if (input$graphtype3 %in% c("throttle")) {
print("This plot displays a map of the track by plotting the longitude and latitude points of the car
on the x and y axes. The throttle pressure is recorded and displayed as a percentage of full throttle. This map
uses a heat mapping to show the change in throttle pressure as the driver drives around the track. Dark red
is the lowest throttle pressure and pale yellow is the highest.")
} else if (input$graphtype3 %in% c("braking")) {
print("This plot displays a map of the track by plotting the longitude and latitude points of the car
on the x and y axes. The brake pressure is recorded and displayed as pounds per square inch. This map
uses a heat mapping to show the change in brake pressure as the driver drives around the track. Dark red
is the lowest brake pressure and pale yellow is the highest.")
} else if (input$graphtype3 %in% c("airfuel")) {
print("This plot displays engine RPM on the x-axis and the ratio of air to fuel in the exhaust on the y-axis.
The line shows the linear trend of the relationship between these two variables as RPM increases.")
} else if (input$graphtype3 %in% c("oilpressure")) {
print("This plot displays a map of the track by plotting the longitude and latitude points of the car
on the x and y axes. The oil pressure is recorded and displayed as pounds per square inch. This map
uses a heat mapping to show the change in oil pressure as the driver drives around the track. Dark red
is the lowest oil pressure and pale yellow is the highest.")
}
})
}
shinyApp(ui = ui, server = server)