Skip to content

R scripts to analyze and visualize data from World Endurance Championship races.

Notifications You must be signed in to change notification settings

Ming-Tang/WEC-Analysis

Repository files navigation

WEC-Analysis

R scripts to analyze and visualize data from World Endurance Championship races.

source("WEC_Analysis.R") # load WEC.Analysis(...) function
source("WEC_Races.R")    # load WEC races

source("Lap_Chart.R")      # lap chart and position chart functions
source("Pit_Analysis.R")   # pitstop analysis functions

Race Data

The race data is placed in the Data/ directory. Each race is in its own directory of Data/<race name>. Race data for 2016 are pre-loaded in the Data/ folder.

Each race directory should contain the following files:

  • Analysis.csv: Chronological analysis
  • Classification.csv: Race classification
  • Grid.csv: Starting grid, scan of Grid.pdf

The starting grid is converted from the PDF file Grid.pdf using Tabula. The command line automation is provided by tabula-java, and it is needed for the Python script.

download.py

Downloads data provided by fiawec.alkamelsystems.com.

Examples:

$ python download.py -s 2016 -e 'LE MANS' -p Data/2016_Le_Mans
$ python download.py -s 2016 -e 'CIRCUIT OF THE AMERICAS' -p Data/2016_COTA

WEC_Analysis.R

R script to perform analysis on the downloaded data. It provides:

  • Grid and Classification
  • Positions: Grid vs finishing positions
  • Analysis: The chronological analysis data
  • Events: Events for lap and sector arrivals

Races.Rmd

Maintains a list of WEC races.

Report_Interactive.Rmd

Interactive app for exploring lap time distribution and finishing positions of WEC races. Requires Shiny to run.

Lap_Charts.Rmd

Code to generate lap charts for each race.

Screenshot

About

R scripts to analyze and visualize data from World Endurance Championship races.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published