Skip to contents

Computes advanced batting features from Cricinfo Hawkeye data: wagon zone distributions, shot type tendencies, and shot control rates.

Usage

calculate_hawkeye_batter_features(conn, player_ids = NULL, min_balls = 30)

Arguments

conn

DBI connection

player_ids

Character vector of batter IDs (optional, NULL = all)

min_balls

Integer. Minimum balls with Hawkeye data for reliable features

Value

data.table with one row per batter:

  • pct_leg_side: % of runs scored on leg side

  • pct_v_zone: % of shots in the V (wagon zones 1-3)

  • pct_boundary_leg: % of boundaries to leg side

  • shot_diversity: Number of distinct shot types used (normalized)

  • pct_controlled: % of shots rated as controlled

  • pct_attacking: % of attacking shot types (drive, pull, sweep, etc.)

  • avg_wagon_x: Mean wagon X (higher = more leg-side)

  • hawkeye_balls: Number of balls with Hawkeye data