Receives season, race number, driver code, and an optional fastest lap only
argument to output car telemetry for the selected situation.
Example usage of this code can be seen in the Introduction vignette (run
vignette('introduction', 'f1dataR')
to read). Multiple drivers' telemetry can be appended
to one data frame by the user.
If you have trouble with errors mentioning 'fastf1' or 'get_fastf1_version()' read the
"Setup FastF1 Connection" vignette (run vignette('setup_fastf1', 'f1dataR')
).
Usage
load_driver_telemetry(
season = get_current_season(),
round = 1,
session = "R",
driver,
laps = "fastest",
log_level = "WARNING",
race = lifecycle::deprecated(),
fastest_only = lifecycle::deprecated()
)
Arguments
- season
number from 2018 to current season (defaults to current season).
- round
number from 1 to 23 (depending on season selected). 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.- driver
three letter driver code (see
load_drivers()
for a list)- laps
which lap's telemetry to return. One of an integer lap number (<= total laps in the race),
fastest
, orall
. Note that integer lap choice requiresfastf1
version 3.0 or greater.- log_level
Detail of logging from fastf1 to be displayed. Choice of:
'DEBUG'
,'INFO'
,'WARNING'
,'ERROR'
and'CRITICAL'
. See fastf1 documentation.- race
- fastest_only
fastest_only
is no longer supported, indicated preferred laps inlaps
.
Examples
if (interactive()) {
telem <- load_driver_telemetry(
season = 2023,
round = "Bahrain",
session = "Q",
driver = "HAM",
laps = "fastest"
)
}