From 0ce9bc4c7ae3ce220510278ce6dd70eecc94b761 Mon Sep 17 00:00:00 2001 From: Philip Bulsink Date: Wed, 25 Sep 2024 20:06:45 -0400 Subject: [PATCH 1/3] Update plot_fastest to extract event name from ff1 session Drops a unsafe reliance on Ergast. --- R/plot_fastest.R | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/R/plot_fastest.R b/R/plot_fastest.R index 6b42dab..dff8231 100644 --- a/R/plot_fastest.R +++ b/R/plot_fastest.R @@ -46,6 +46,7 @@ plot_fastest <- function(season = get_current_season(), round = 1, session = "R" driver_abbreviation <- driver } + s <- load_race_session(season = season, round = round, session = session) driver_data <- load_driver_telemetry(season, round, session, driver_abbreviation, "fastest") if (is.null(driver_data)) { @@ -83,11 +84,7 @@ plot_fastest <- function(season = get_current_season(), round = 1, session = "R" lap_time <- paste0(" | ", lap_time) } - rnd <- round - # I can't figure out why but for some reason the filter .data$round == round doesn't work. Rename to rnd fixes. - race_name <- load_schedule(season) %>% - dplyr::filter(.data$round == rnd) %>% - dplyr::pull(.data$race_name) + race_name <- s$event$EventName if (!(session %in% c("r", "R"))) { race_name <- dplyr::case_match( From b267d7068cd0b3430026f66d8905230f5310b778 Mon Sep 17 00:00:00 2001 From: Philip Bulsink Date: Wed, 25 Sep 2024 20:08:28 -0400 Subject: [PATCH 2/3] Readme update #267 --- README.Rmd | 2 +- README.md | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/README.Rmd b/README.Rmd index b0182fe..fd89a46 100644 --- a/README.Rmd +++ b/README.Rmd @@ -38,7 +38,7 @@ An R package to access Formula 1 Data from the Ergast API and the official F1 da [![Codecov test coverage](https://img.shields.io/codecov/c/github/SCasanova/f1dataR?label=codecov&logo=codecov)](https://app.codecov.io/gh/SCasanova/f1dataR?branch=main) [![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable) [![CRAN status](https://www.r-pkg.org/badges/version/f1dataR)](https://CRAN.R-project.org/package=f1dataR) -[![CRAN downloads](http://cranlogs.r-pkg.org/badges/grand-total/f1dataR)](https://CRAN.R-project.org/package=f1dataR) +[![CRAN downloads](https://cranlogs.r-pkg.org/badges/grand-total/f1dataR)](https://CRAN.R-project.org/package=f1dataR) ## Installation diff --git a/README.md b/README.md index 58f1c14..0bdfc5e 100644 --- a/README.md +++ b/README.md @@ -8,14 +8,10 @@ official F1 data stream via the FastF1 Python library. [![R-CMD-check](https://github.com/SCasanova/f1dataR/actions/workflows/check-standard.yaml/badge.svg)](https://github.com/SCasanova/f1dataR/actions/workflows/check-standard.yaml) [![test-coverage](https://github.com/SCasanova/f1dataR/actions/workflows/test-coverage.yaml/badge.svg)](https://github.com/SCasanova/f1dataR/actions/workflows/test-coverage.yaml) -[![Codecov test -coverage](https://img.shields.io/codecov/c/github/SCasanova/f1dataR?label=codecov&logo=codecov)](https://app.codecov.io/gh/SCasanova/f1dataR?branch=main) -[![Lifecycle: -stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable) -[![CRAN -status](https://www.r-pkg.org/badges/version/f1dataR)](https://CRAN.R-project.org/package=f1dataR) -[![CRAN -downloads](http://cranlogs.r-pkg.org/badges/grand-total/f1dataR)](https://CRAN.R-project.org/package=f1dataR) +[![Codecov test coverage](https://img.shields.io/codecov/c/github/SCasanova/f1dataR?label=codecov&logo=codecov)](https://app.codecov.io/gh/SCasanova/f1dataR?branch=main) +[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable) +[![CRAN status](https://www.r-pkg.org/badges/version/f1dataR)](https://CRAN.R-project.org/package=f1dataR) +[![CRAN downloads](https://cranlogs.r-pkg.org/badges/grand-total/f1dataR)](https://CRAN.R-project.org/package=f1dataR) ## Installation From 7fd5df2961a4bcc4162ebe8fe5a7e2a555df578a Mon Sep 17 00:00:00 2001 From: Philip Bulsink Date: Wed, 25 Sep 2024 20:10:29 -0400 Subject: [PATCH 3/3] Record fixes in NEWS --- NEWS.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NEWS.md b/NEWS.md index f85d638..7b3cd59 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,9 @@ # f1dataR 1.6.0.9000 +* Bugfix in plot_fastest() +* Bugfix in README + # f1dataR 1.6.0 * Updates per FastF1 (python) updates at 3.4.0 #259