load_race_session {f1dataR}R Documentation

Load Session Data

Description

Loads telemetry and general data from the official F1 data stream via the fastf1 python library. Data is available from 2018 onward.

The data loaded can optionally be assigned to a R variable, and then interrogated for session data streams. See the fastf1 documentation for more details on the data returned by the python API.

If you have trouble with errors mentioning 'fastf1' or 'get_fastf1_version()' read the 'Setup FastF1 Connection vignette (run vignette('setup_fastf1', 'f1dataR')).

Cache directory can be set by setting ⁠option(f1dataR.cache = [cache dir])⁠, default is the current working directory.

Usage

load_race_session(
  obj_name = "session",
  season = get_current_season(),
  round = 1,
  session = "R",
  log_level = "WARNING",
  race = lifecycle::deprecated()
)

Arguments

obj_name

name assigned to the loaded session to be referenced later. Leave as 'session' unless otherwise required.

season

number from 2018 to current season. Defaults to current season.

round

number from 1 to 23 (depending on season selected) and defaults to most recent. Also accepts race name.

session

the code for the session to load. Options are 'FP1', 'FP2', 'FP3', 'Q', 'S', 'SS','SQ', and 'R'. Default is 'R', which refers to Race.

log_level

Detail of logging from fastf1 to be displayed. Choice of: 'DEBUG', 'INFO', 'WARNING', 'ERROR' and 'CRITICAL.' See fastf1 documentation.

race

[Deprecated] race is no longer supported, use round

Value

A session object to be used in other functions invisibly.

See Also

load_session_laps() plot_fastest()

Examples

# Load the quali session from 2019 first round
if (interactive()) {
  session <- load_race_session(season = 2019, round = 1, session = "Q")
}

[Package f1dataR version 1.5.3 Index]