Skip to contents

Parses a Cricsheet JSON file with optimized vectorized operations. Uses pre-allocation and single-pass parsing for high performance.

Usage

parse_cricsheet_json(file_path)

Arguments

file_path

Character string path to JSON file

Value

A list with parsed data:

  • match_info: data frame with match metadata

  • innings: data frame with innings summaries (includes target, super_over, absent_hurt)

  • deliveries: data frame with ball-by-ball data (includes DRS reviews, substitute fielders, replacements)

  • players: data frame with player information

  • powerplays: data frame with powerplay periods per innings

Details

For faster parsing, install the optional RcppSimdJson package: install.packages("RcppSimdJson") (5-15x faster than jsonlite).

Examples

if (FALSE) { # \dontrun{
# Parse a single match file
match_data <- parse_cricsheet_json("64012.json")

# Access different components
match_info <- match_data$match_info
deliveries <- match_data$deliveries
} # }