Title: NASCAR Race Data
Version: 2.2.2
Maintainer: Kyle Grealis <kylegrealis@icloud.com>
Description: A collection of NASCAR race, driver, owner and manufacturer data across the three major NASCAR divisions: NASCAR Cup Series, NASCAR Xfinity Series, and NASCAR Craftsman Truck Series. The curated data begins with the 1949 season and extends through the end of the 2024 season. Explore race, season, or career performance for drivers, teams, and manufacturers throughout NASCAR's history. Data was sourced with permission from DriverAverages.com.
LazyData: true
LazyDataCompression: bzip2
License: GPL (≥ 3)
Depends: R (≥ 4.1.0)
Encoding: UTF-8
RoxygenNote: 7.3.2
Imports: dplyr, glue, purrr, rlang, rvest, stringdist, stringr
Suggests: roxygen2, scales
URL: https://azimuth-project.tech/nascaR.data/
BugReports: https://github.com/kyleGrealis/nascaR.data/issues
NeedsCompilation: no
Packaged: 2025-06-02 21:45:00 UTC; kyle
Author: Kyle Grealis ORCID iD [aut, cre], Nick Triplett [ctb], Gabriel Odom ORCID iD [ctb]
Repository: CRAN
Date/Publication: 2025-06-02 22:00:02 UTC

nascaR.data: NASCAR Race Data

Description

A collection of NASCAR race, driver, owner and manufacturer data across the three major NASCAR divisions: NASCAR Cup Series, NASCAR Xfinity Series, and NASCAR Craftsman Truck Series. The curated data begins with the 1949 season and extends through the end of the 2024 season. Explore race, season, or career performance for drivers, teams, and manufacturers throughout NASCAR's history. Data was sourced with permission from DriverAverages.com.

Author(s)

Maintainer: Kyle Grealis kylegrealis@icloud.com (ORCID)

Other contributors:

See Also

Useful links:


NASCAR Cup Series Race Data

Description

Historical race results for NASCAR Cup Series races from 1949-present. Includes finishing position, driver and car information, track details, and performance metrics for each entry.

Usage

cup_series

Format

A data frame with rows representing each car/driver entry and 19 columns:

Season

Race season year

Race

Race number within the season

Track

Name of the racetrack

Name

Official race name

Length

Track length in miles

Surface

Track surface type (e.g., "road", "oval")

Finish

Finishing position

Start

Starting position

Car

Car number

Driver

Driver name

Team

Racing team name

Make

Car manufacturer

Pts

Championship points earned

Laps

Number of laps completed

Led

Number of laps led

Status

Race completion status (e.g., "running", "crash")

S1

Segment 1 finish position

S2

Segment 2 finish position

Seg Points

Segment points – deprecated

Rating

Driver rating for the race

Win

Binary indicator if driver won the race (1 = yes, 0 = no)

Source

Data scraped from Driver Averages (https://www.driveraverages.com)


Find Driver Matches

Description

Find Driver Matches

Usage

find_driver(search_term, data = NULL, max_results = 5, interactive = TRUE)

Arguments

search_term

Character string to search for

data

Tibble containing NASCAR race data

max_results

Maximum number of matches to return

interactive

Logical. Is the session interactive?

Value

Character vector of matching driver names

Examples

# Find exact match
find_driver("Christopher Bell")

# Find partial matches
find_driver("bell")

# Non-interactive mode for scripts
find_driver("kyle", interactive = FALSE)

Find Manufacturer Matches

Description

Find Manufacturer Matches

Usage

find_manufacturer(
  search_term,
  data = NULL,
  max_results = 5,
  interactive = TRUE
)

Arguments

search_term

Character string to search for

data

Tibble containing NASCAR race data or series specification

max_results

Maximum number of matches to return

interactive

Logical. Is the session interactive?

Value

Character vector of matching manufacturer names

Examples

# Find exact match
find_manufacturer("Toyota")

# Find with common alias
find_manufacturer("chevy")

# Non-interactive mode for scripts
find_manufacturer("ford", interactive = FALSE)

Find Team Matches

Description

Find Team Matches

Usage

find_team(search_term, data = NULL, max_results = 5, interactive = TRUE)

Arguments

search_term

Character string to search for

data

Tibble containing NASCAR race data or series specification

max_results

Maximum number of matches to return

interactive

Logical. Is the session interactive?

Value

Character vector of matching team names

Examples

# Find exact match
find_team("Joe Gibbs Racing")

# Find partial matches
find_team("gibbs")

# Non-interactive mode for scripts
find_team("hendrick", interactive = FALSE)

Enhanced Get Driver Info with Smart Matching

Description

Enhanced Get Driver Info with Smart Matching

Usage

get_driver_info(driver, series = "all", type = "summary", interactive = TRUE)

Arguments

driver

Character string of driver name to search for

series

Either character string ("cup", "xfinity", "truck", "all") or data frame

type

Character string specifying return type ("summary", "season", "all")

interactive

Logical. Is the session interactive?

Value

Tibble with driver statistics or NULL if no exact match

Examples

## Not run: 
# Get Christopher Bell's career summary
get_driver_info("Christopher Bell")

# Handle misspelling - will prompt for selection
get_driver_info("cristopher bell")
# Found 1 drivers matching 'cristopher bell':
#  1 - Christopher Bell
# Select driver number: 1
# Driver: Christopher Bell
# Returns summary table

# Get season-by-season data for Cup series only
get_driver_info("Christopher Bell", series = "cup", type = "season")

## End(Not run)

Enhanced Get Manufacturer Info with Smart Matching

Description

Enhanced Get Manufacturer Info with Smart Matching

Usage

get_manufacturer_info(
  manufacturer,
  series = "all",
  type = "summary",
  interactive = TRUE
)

Arguments

manufacturer

Character string of manufacturer name to search for

series

Either character string ("cup", "xfinity", "truck", "all") or data frame

type

Character string specifying return type ("summary", "season", "all")

interactive

Logical. Is the session interactive?

Value

Tibble with manufacturer statistics or NULL if no exact match

Examples

## Not run: 
# Get Toyota career summary
get_manufacturer_info("Toyota")

# Handle misspelling - will prompt for selection
get_manufacturer_info("toyoda")
# Found 1 manufacturers matching 'toyoda':
#  1 - Toyota
# Select manufacturer number: 1
# Manufacturer: Toyota
# Returns summary table

# Get season-by-season data for Cup series only
get_manufacturer_info("Toyota", series = "cup", type = "season")

## End(Not run)

Enhanced Get Team Info with Smart Matching

Description

Enhanced Get Team Info with Smart Matching

Usage

get_team_info(team, series = "all", type = "summary", interactive = TRUE)

Arguments

team

Character string of team name to search for

series

Either character string ("cup", "xfinity", "truck", "all") or data frame

type

Character string specifying return type ("summary", "season", "all")

interactive

Logical. Is the session interactive?

Value

Tibble with team statistics or NULL if no exact match

Examples

## Not run: 
# Get Joe Gibbs Racing career summary
get_team_info("Joe Gibbs Racing")

# Handle partial name - will prompt for selection
get_team_info("joe gib racing")
# Found 1 teams matching 'joe gib racing':
#  1 - Joe Gibbs Racing
# Select team number: 1
# Team: Joe Gibbs Racing
# Returns summary table

# Get season-by-season data for Cup series only
get_team_info("Joe Gibbs Racing", series = "cup", type = "season")

## End(Not run)

Filter race data by series

Description

Filter race data by series

Usage

selected_series_data(the_series)

Arguments

the_series

A string specifying the race series. Must be one of 'cup', 'xfinity', 'truck', or 'all'.

Value

A tibble containing race results for the specified series.


NASCAR Truck Series Race Data

Description

Historical race results for NASCAR Truck Series races from 1995-present. Includes finishing position, driver and car information, track details, and performance metrics for each entry.

Usage

truck_series

Format

A data frame with rows representing each car/driver entry and 19 columns:

Season

Race season year

Race

Race number within the season

Track

Name of the racetrack

Name

Official race name

Length

Track length in miles

Surface

Track surface type (e.g., "road", "oval")

Finish

Finishing position

Start

Starting position

Car

Car number

Driver

Driver name

Team

Racing team name

Make

Car manufacturer

Pts

Championship points earned

Laps

Number of laps completed

Led

Number of laps led

Status

Race completion status (e.g., "running", "crash")

S1

Segment 1 finish position

S2

Segment 2 finish position

Seg Points

Segment points – deprecated

Rating

Driver rating for the race

Win

Binary indicator if driver won the race (1 = yes, 0 = no)

Source

Data scraped from Driver Averages (https://www.driveraverages.com)


NASCAR Xfinity Series Race Data

Description

Historical race results for NASCAR Xfinity Series races from 1982-present. Includes finishing position, driver and car information, track details, and performance metrics for each entry.

Usage

xfinity_series

Format

A data frame with rows representing each car/driver entry and 19 columns:

Season

Race season year

Race

Race number within the season

Track

Name of the racetrack

Name

Official race name

Length

Track length in miles

Surface

Track surface type (e.g., "road", "oval")

Finish

Finishing position

Start

Starting position

Car

Car number

Driver

Driver name

Team

Racing team name

Make

Car manufacturer

Pts

Championship points earned

Laps

Number of laps completed

Led

Number of laps led

Status

Race completion status (e.g., "running", "crash")

S1

Segment 1 finish position

S2

Segment 2 finish position

Seg Points

Segment points – deprecated

Rating

Driver rating for the race

Win

Binary indicator if driver won the race (1 = yes, 0 = no)

Source

Data scraped from Driver Averages (https://www.driveraverages.com)