
1975-2003 NASCAR R Shiny Visualization
Background
This week we received a dataset of NASCAR from 1975 to 2003. The dataset has each NASCAR race from 1975 to 2003 and includes track, winning points, driver, car brand, and so on. I wanted to make an interactive visualization to showcase how many champions a car brand win in a certain year or at a certain track. Also, what was the average points for a car brand in a certain year or at a certain track.
Data
The dataset has two parts, one is for the driver and one is for the race. The first thing I did was combine these two with "race_num". I also created a list with the car brand's image and color. Next, I unique the year and track so I can have them in the R Shiny app as select input.
R
After having my dataset all prepared, I started the coding part. My thought process was to showcase the champions' number and average points in terms of a car brand. I wanted people to be able to select what year or track they want to see. So I used Shiny app to help me achieve this purpose by having select input. For output, I want to make two plots with one bar plot and one scatter plot. The bar plot is to show how many champions a car brand had in a certain condition. The scatter plot is to show the car brand's average point in a certain condition. I used a lot of if-else functions here just so people can choose what condition they want.
Summary
This was the first time I made an interactive visualization with multiple choice. I struggled a bit when I was trying to make my logic make sense. I'm glad this turned out well and the result is what I want. We can see from the plot that Chevrolet was a very strong team during 1975-2003 and followed by Ford. Also, we can see that even though Chevrolet they won a lot of titles but they did not have high average points because they had so many drivers on their team so the average points was lower then I was expected.