Skip to content

Commit

Permalink
Merge pull request #99 from SCasanova/devtest
Browse files Browse the repository at this point in the history
Introduction update and `pkgdown` re-build
  • Loading branch information
SCasanova committed Jun 25, 2023
2 parents b30cb6c + 313d59b commit eb483e7
Show file tree
Hide file tree
Showing 60 changed files with 1,476 additions and 269 deletions.
4 changes: 2 additions & 2 deletions R/load_driver_telemetry.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
#' @examples
#' \dontrun{
#' telem <- load_driver_telemetry(season = 2023,
#' round = 'bahrain', s
#' ession = 'Q',
#' round = 'bahrain',
#' session = 'Q',
#' driver = 'HAM',
#' fastest_only = TRUE)
#' }
Expand Down
2 changes: 1 addition & 1 deletion R/load_race_session.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#' @examples
#' \dontrun{
#' Load the quali session from 2019 first round
#' session<-load_race_session(season = 2019, round = 1, session = 'Q')
#' session <- load_race_session(season = 2019, round = 1, session = 'Q')
#' }
load_race_session <- function(obj_name="session", season = get_current_season(), round =1, session = 'R', log_level = "WARNING", race = lifecycle::deprecated()){
if (lifecycle::is_present(race)) {
Expand Down
2 changes: 1 addition & 1 deletion R/plot_fastest.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ plot_fastest <- function(season = get_current_season(), round = 1, session = 'R'
subtitle = glue::glue('{driver} Fastest Lap | {lap_time}',driver = driver, lap_time = lap_time),
caption = 'Generated by {f1dataR} package')
} else if(color == 'speed'){
ggplot2::ggplot(driver_data, ggplot2::aes(.data$x, .data$y, color = .data$speed, group = .data$time)) +
ggplot2::ggplot(driver_data, ggplot2::aes(.data$x, .data$y, color = .data$speed, group = NA)) +
ggplot2::geom_path(linewidth = 4, lineend = 'round') +
ggplot2::scale_color_gradient(low = 'white', high = 'red')+
theme_dark_f1() +
Expand Down
5 changes: 4 additions & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#' @param url the complete Ergast URL to get
#' @keywords internal
#' @return the result of `jsonlite::fromJSON` called on ergast's return content

get_ergast_content<-function(url){
fullurl<-glue::glue("https://ergast.com/api/f1/{url}", url = url)
res <- httr::GET(fullurl,
Expand Down Expand Up @@ -39,6 +40,7 @@ get_ergast_content<-function(url){
#' @description Looks up current season from ergast, fallback to manual determination
#' @keywords internal
#' @return Year (four digit number) representation of current season, as numeric.

.get_current_season<-function(){
tryCatch({
url <- glue::glue('current.json?limit=30')
Expand All @@ -56,6 +58,7 @@ get_ergast_content<-function(url){
}

#' @inherit .get_current_season title description return
#' @keywords internal
#' @export
#' @examples
#' # Get the current season
Expand All @@ -67,10 +70,10 @@ get_current_season <- memoise::memoise(.get_current_season)
#'
#' @description
#' Gets the current installed FastF1 version available (via `reticulate`) to the function.
#'
#' Displays a note if significantly out of date.
#' @keywords internal
#' @return integer for major version number (or NA if any error )

.get_fastf1_version <- function(){
ver<-reticulate::py_list_packages() %>%
dplyr::filter(.data$package == "fastf1") %>%
Expand Down
5 changes: 4 additions & 1 deletion docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion docs/LICENSE-text.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion docs/articles/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit eb483e7

Please sign in to comment.