Import Data

results <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-09-07/results.csv')
## Warning: One or more parsing issues, see `problems()` for details
## Rows: 25220 Columns: 18
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr  (8): position, positionText, time, milliseconds, fastestLap, rank, fast...
## dbl (10): resultId, raceId, driverId, constructorId, number, grid, positionO...
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
results
## # A tibble: 25,220 × 18
##    resultId raceId driverId constr…¹ number  grid posit…² posit…³ posit…⁴ points
##       <dbl>  <dbl>    <dbl>    <dbl>  <dbl> <dbl> <chr>   <chr>     <dbl>  <dbl>
##  1        1     18        1        1     22     1 "1"     1             1     10
##  2        2     18        2        2      3     5 "2"     2             2      8
##  3        3     18        3        3      7     7 "3"     3             3      6
##  4        4     18        4        4      5    11 "4"     4             4      5
##  5        5     18        5        1     23     3 "5"     5             5      4
##  6        6     18        6        3      8    13 "6"     6             6      3
##  7        7     18        7        5     14    17 "7"     7             7      2
##  8        8     18        8        6      1    15 "8"     8             8      1
##  9        9     18        9        2      4     2 "\\N"   R             9      0
## 10       10     18       10        7     12    18 "\\N"   R            10      0
## # … with 25,210 more rows, 8 more variables: laps <dbl>, time <chr>,
## #   milliseconds <chr>, fastestLap <chr>, rank <chr>, fastestLapTime <chr>,
## #   fastestLapSpeed <chr>, statusId <dbl>, and abbreviated variable names
## #   ¹​constructorId, ²​position, ³​positionText, ⁴​positionOrder

Question

Which drivers had the fastest lap times in the Monaco Grand Prix?

Data and Variables Used

To answer this question, I used the Formula 1 races data set. This data set had many subsets, and I specifically used the race results data set to aid in my analysis. The variables I used in the results data set were "driverId", "raceId", and "position". driverId uses numbers to categorize each driver by different numbers. RaceId categorized the different races by a specific number ID. Position only contains variables between the numbers 1-20 and "/N" for drivers who disqualified from the race. With this data set and these variables within the data set, I was able to see which drivers had the fastest lap times in the Monaco Grand Prix. 

Relevant Code and Analysis

results %>% 
    filter(raceId == "1056") %>% 
    select(raceId, fastestLapTime, driverId) %>% 
    
    ggplot(aes(x = driverId, y = fastestLapTime)) + 
    geom_point()

Conclusion

With the code and plot, we can analyze the fastest lap times for specific drivers. According to this chart one driver was disqualified from this race. The slowest lap time was 1:16.866, and the fastest lap time was 1:12.909. The tibble I created that filtered the data set for raceId "1056", which is the race ID for the Monaco Grand Prix, shows the fastest lap time, and which drivers achieved these times. The fastest lap time was achieved by the driver that goes by the driver ID of "1". The slowest lap time was achieved by the driver with "853" as his driver ID.