Skip to contents

Retrieves and summarizes NASCAR race statistics for a specified team across different racing series. The function provides flexibility in viewing career summaries, season-by-season breakdowns, or complete race-by-race data.

Usage

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

Arguments

team

Character string specifying an team name (case-insensitive, fuzzy matching available)

series

Character string specifying the racing series to analyze. Must be one of:

  • 'all' (default)

  • 'Cup'

  • 'Xfinity'

  • 'Truck'

type

Character string specifying the type of summary to return. Must be one of:

  • 'summary' (default): Career statistics grouped by series

  • 'season': Season-by-season statistics for each series

  • 'all': Complete race-by-race data

Value

A tibble containing team statistics based on the specified type:

  • For type = 'summary': Career statistics grouped by series

  • For type = 'season': Season-by-season breakdown

  • For type = 'all': Complete race-by-race data

Examples

if (interactive()) {
  # Get career summary for Joe Gibbs Racing across all series
  get_team_info("Joe Gibbs Racing")

  # Get Cup series statistics only
  get_team_info("Joe Gibbs Racing", series = "cup")

  # Get season-by-season breakdown for Truck series
  get_team_info("Joe Gibbs Racing", series = "truck", type = "season")
}