Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Column object for statcast data with correct data types
statcast_cols <- cols(
pitch_type = col_character(),
game_date = col_date(format = ""),
release_speed = col_double(),
release_pos_x = col_double(),
release_pos_z = col_double(),
player_name = col_character(),
batter = col_double(),
pitcher = col_double(),
events = col_character(),
description = col_character(),
spin_dir = col_double(),
spin_rate_deprecated = col_logical(),
break_angle_deprecated = col_logical(),
break_length_deprecated = col_logical(),
zone = col_double(),
des = col_character(),
game_type = col_character(),
stand = col_character(),
p_throws = col_character(),
home_team = col_character(),
away_team = col_character(),
type = col_character(),
hit_location = col_double(),
bb_type = col_character(),
balls = col_double(),
strikes = col_double(),
game_year = col_double(),
pfx_x = col_double(),
pfx_z = col_double(),
plate_x = col_double(),
plate_z = col_double(),
on_3b = col_double(),
on_2b = col_double(),
on_1b = col_double(),
outs_when_up = col_double(),
inning = col_double(),
inning_topbot = col_character(),
hc_x = col_double(),
hc_y = col_double(),
tfs_deprecated = col_logical(),
tfs_zulu_deprecated = col_logical(),
fielder_2 = col_double(),
umpire = col_double(),
sv_id = col_character(),
vx0 = col_double(),
vy0 = col_double(),
vz0 = col_double(),
ax = col_double(),
ay = col_double(),
az = col_double(),
sz_top = col_double(),
sz_bot = col_double(),
hit_distance_sc = col_double(),
launch_speed = col_double(),
launch_angle = col_double(),
effective_speed = col_double(),
release_spin_rate = col_double(),
release_extension = col_double(),
game_pk = col_double(),
pitcher_1 = col_double(),
fielder_2_1 = col_double(),
fielder_3 = col_double(),
fielder_4 = col_double(),
fielder_5 = col_double(),
fielder_6 = col_double(),
fielder_7 = col_double(),
fielder_8 = col_double(),
fielder_9 = col_double(),
release_pos_y = col_double(),
estimated_ba_using_speedangle = col_double(),
estimated_woba_using_speedangle = col_double(),
woba_value = col_double(),
woba_denom = col_double(),
babip_value = col_double(),
iso_value = col_double(),
launch_speed_angle = col_double(),
at_bat_number = col_double(),
pitch_number = col_double(),
pitch_name = col_character(),
home_score = col_double(),
away_score = col_double(),
bat_score = col_double(),
fld_score = col_double(),
post_away_score = col_double(),
post_home_score = col_double(),
post_bat_score = col_double(),
post_fld_score = col_double(),
if_fielding_alignment = col_character(),
of_fielding_alignment = col_character()
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment