| Title: | NASCAR Race Data |
|---|---|
| Description: | A collection of NASCAR race, driver, owner and manufacturer data across the three major NASCAR divisions: NASCAR Cup Series, NXS, and NASCAR Craftsman Truck Series. The curated data begins with the 1949 season and is updated weekly during the racing season. Explore race, season, or career performance for drivers, teams, and manufacturers throughout NASCAR's history. Data was sourced with permission from DriverAverages.com. |
| Authors: | Kyle Grealis [aut, cre] (ORCID: <https://orcid.org/0000-0002-9223-8854>), Nick Triplett [ctb], Gabriel Odom [ctb] (ORCID: <https://orcid.org/0000-0003-1341-4555>) |
| Maintainer: | Kyle Grealis <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 3.0.1 |
| Built: | 2026-06-05 10:01:09 UTC |
| Source: | https://github.com/kylegrealis/nascar.data |
Clears the in-memory cache so the next call to
load_series() will re-download from cloud storage.
Also removes any leftover disk cache from previous
package versions.
clear_cache()clear_cache()
Invisibly returns NULL.
load_series() for data access.
## Not run: # Clear in-memory cache clear_cache() # Next call downloads fresh data cup <- load_series("cup") ## End(Not run)## Not run: # Clear in-memory cache clear_cache() # Next call downloads fresh data cup <- load_series("cup") ## End(Not run)
Search for a driver by name and return career statistics. Supports partial names, typos, and case-insensitive input via the built-in fuzzy matching engine.
get_driver_info(driver, series = "all", type = "summary", interactive = TRUE)get_driver_info(driver, series = "all", type = "summary", interactive = TRUE)
driver |
Character string of the driver name to search
for. Supports partial names and common misspellings
(e.g., |
series |
Character string ( |
type |
Character string specifying the return format:
|
interactive |
Logical. When |
A tibble of driver statistics (format depends on
type), or invisible(NULL) if no match is found.
get_team_info(), get_manufacturer_info(),
load_series(), series_data
# Career summary across all series get_driver_info("Christopher Bell") # Season-by-season Cup data get_driver_info( "Christopher Bell", series = "cup", type = "season" )# Career summary across all series get_driver_info("Christopher Bell") # Season-by-season Cup data get_driver_info( "Christopher Bell", series = "cup", type = "season" )
Search for a manufacturer by name and return performance statistics. Uses fuzzy matching to handle partial names, typos, and case-insensitive searches.
get_manufacturer_info( manufacturer, series = "all", type = "summary", interactive = TRUE )get_manufacturer_info( manufacturer, series = "all", type = "summary", interactive = TRUE )
manufacturer |
Character string of the manufacturer name to search for. |
series |
Character string ( |
type |
Character string specifying the return format:
|
interactive |
Logical. When |
A tibble of manufacturer statistics (format depends on
type), or invisible(NULL) if no match is found.
get_driver_info(), get_team_info(),
load_series(), series_data
# Career summary across all series get_manufacturer_info("Toyota") # Season-by-season Cup data get_manufacturer_info( "Toyota", series = "cup", type = "season" )# Career summary across all series get_manufacturer_info("Toyota") # Season-by-season Cup data get_manufacturer_info( "Toyota", series = "cup", type = "season" )
Search for a team by name and return performance statistics. Supports partial names, typos, and case-insensitive input via the built-in fuzzy matching engine.
get_team_info(team, series = "all", type = "summary", interactive = TRUE)get_team_info(team, series = "all", type = "summary", interactive = TRUE)
team |
Character string of the team name to search for.
Supports partial names and common misspellings
(e.g., |
series |
Character string ( |
type |
Character string specifying the return format:
|
interactive |
Logical. When |
A tibble of team statistics (format depends on
type), or invisible(NULL) if no match is found.
get_driver_info(), get_manufacturer_info(),
load_series(), series_data
# Career summary across all series get_team_info("Joe Gibbs Racing") # Season-by-season Cup data get_team_info( "Joe Gibbs Racing", series = "cup", type = "season" )# Career summary across all series get_team_info("Joe Gibbs Racing") # Season-by-season Cup data get_team_info( "Joe Gibbs Racing", series = "cup", type = "season" )
Downloads NASCAR series data from Cloudflare R2 as a parquet file. Data is cached in memory for the current R session so repeated calls are instant. Each new R session downloads fresh data, ensuring you always have the latest results.
load_series(series = c("cup", "nxs", "truck"), refresh = FALSE)load_series(series = c("cup", "nxs", "truck"), refresh = FALSE)
series |
Character. The series to load. One of |
refresh |
Logical. If |
NASCAR's NXS uses the sponsor-neutral identifier "nxs"
rather than a sponsor name. The series has been sponsored by
Busch (1984-2007), Nationwide (2008-2014), Xfinity
(2015-2025), and O'Reilly Auto Parts (2026-present). Using
"nxs" keeps the identifier stable across sponsor changes.
Data is cached in memory for the current R session. Repeated calls return instantly without re-downloading. Starting a new R session always fetches the latest data from R2.
Use refresh = TRUE to force a re-download within a session,
or clear_cache() to reset the in-memory cache.
A data frame with 21 columns of race results: Season, Race, Track, Name, Length, Surface, Finish, Start, Car, Driver, Team, Make, Pts, Laps, Led, Status, S1, S2, S3, Rating, and Win.
series_data for column descriptions,
clear_cache() for cache management,
get_driver_info() for driver statistics.
# Load Cup Series data (downloads on first call, cached after) cup <- load_series("cup") # Load NXS data nxs <- load_series("nxs") # Load Truck Series data truck <- load_series("truck") # Force re-download from cloud storage cup <- load_series("cup", refresh = TRUE)# Load Cup Series data (downloads on first call, cached after) cup <- load_series("cup") # Load NXS data nxs <- load_series("nxs") # Load Truck Series data truck <- load_series("truck") # Force re-download from cloud storage cup <- load_series("cup", refresh = TRUE)
Historical race results from NASCAR's three major national series,
sourced with permission from
DriverAverages.com. Data is hosted
on Cloudflare R2 and accessed via load_series().
The NASCAR Cup Series is the sport's premier division. Originally called the Strictly Stock Series in its inaugural 1949 season, it has been known by several names tied to title sponsors: Grand National (1950–1970), Winston Cup (1971–2003), Nextel Cup (2004–2007), Sprint Cup (2008–2016), Monster Energy Cup (2017–2019), and the NASCAR Cup Series (2020–present).
cup <- load_series("cup")
NASCAR's second-tier national series, often considered a proving ground for drivers aspiring to reach the Cup Series. It debuted in 1982 as the Budweiser Late Model Sportsman Series and has carried the names of several title sponsors: Busch Series (1984–2007), Nationwide Series (2008–2014), Xfinity Series (2015–2025), and the O'Reilly Auto Parts Series (2026–present).
nxs <- load_series("nxs")
The series identifier is "nxs", NASCAR's own sponsor-neutral
abbreviation. This avoids tying the code to any single title sponsor.
The NASCAR Craftsman Truck Series features modified pickup trucks racing on a mix of ovals, short tracks, road courses, and dirt tracks. It launched in 1995 as the SuperTruck Series and has been sponsored under the names Craftsman Truck (1995–2008), Camping World Truck (2009–2022), and Craftsman Truck again (2023–present).
truck <- load_series("truck")
All three series share the same column structure:
Integer. Year the race took place.
Integer. Race number within the season.
Character. Name of the track or venue.
Character. Official race name (includes sponsor).
Numeric. Track length in miles.
Character. Track surface type
(e.g., "Paved", "Dirt").
Integer. Official finishing position.
Integer. Starting grid position.
Character. Car number.
Character. Driver's full name.
Character. Team or car owner name.
Character. Vehicle manufacturer
(e.g., "Chevrolet", "Ford", "Toyota").
Integer. Championship points earned.
Integer. Total laps completed.
Integer. Number of laps led.
Character. Race completion status
(e.g., "Running", "Crash", "Engine").
Numeric. Stage 1 points (2017–present,
NA for earlier seasons).
Numeric. Stage 2 points (2017–present,
NA for earlier seasons).
Numeric. Stage 3 points. Cup Series only,
2024–present (NA for NXS, Truck, and pre-2024 Cup).
Numeric. Driver/loop rating for the race
(NA where unavailable).
Integer. Win indicator (1 = won, 0 = did not win).
All data is sourced with permission from
DriverAverages.com and updated
weekly via an automated pipeline. See load_series() for access
details and clear_cache() for cache management.