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 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( 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