-
Notifications
You must be signed in to change notification settings - Fork 0
/
pbp2018.R
58 lines (58 loc) · 2.6 KB
/
pbp2018.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#'@title 2018 MLB pitcher data
#'
#'@description
#'Pitch by pitch data for select pitchers in the 2018 MLB season.
#'
#'@docType data
#'@keywords datasets
#'@name pbp2018
#'@usage pbp2018
#'
#'@format A data frame with 84007 rows and 33 variables.
#'
#'The variables are as follows:
#'\describe{
#' \item{player_name}{pitcher name}
#' \item{game_date}{game date}
#' \item{pitch_type}{type of pitch (abbreviation)}
#' \item{pitch_name}{type of pitch (full)}
#' \item{release_speed}{pitch velocity at release point}
#' \item{events}{result of play}
#' \item{description}{result of pitch}
#' \item{stand}{batter handedness}
#' \item{p_throws}{pitcher handedness}
#' \item{bb_type}{batted ball type}
#' \item{balls}{number of balls}
#' \item{strikes}{number of strikes}
#' \item{plate_x}{horizontal location of pitch in strike zone from the umpire's perspective (zero is the middle of the strike zone)}
#' \item{plate_z}{vertical location of pitch in strike zone from the umpire's perspective (zero is ground level at the point the pitch crosses the plate)}
#' \item{on_3b}{TRUE if a runner is on third base}
#' \item{on_2b}{TRUE if a runner is on second base}
#' \item{on_1b}{TRUE if a runner is on first base}
#' \item{outs}{number of outs}
#' \item{inning}{inning number}
#' \item{inning_topbot}{top or bottom of the inning}
#' \item{launch_speed}{exit velocity off the bat}
#' \item{launch_angle}{launch angle off the bat}
#' \item{effective_speed}{"perceived velocity": pitch velocity adjusted for extension of the pitcher at the release point}
#' \item{release_spin_rate}{spin rate (in revolutions per minute) of the pitch}
#' \item{release_extension}{horizontal distance from pitcher's mound to release point of the pitch}
#' \item{estimated_ba_using_speedangle}{expected batting average based on exit velocity and launch angle}
#' \item{estimated_woba_using_speedangle}{expected weighted on-base average based on exit velocity and launch angle}
#' \item{at_bat_number}{nth batter of the game to face the current pitcher}
#' \item{pitch_number}{nth pitch in the current at bat}
#' \item{bat_score}{current score for offensive team}
#' \item{fld_score}{current score for defensive team}
#' \item{if_fielding_alignment}{type of infield shift}
#' \item{of_fielding_alignment}{type of outfield shift}
#'
#'}
#'
#'@source The data was obtained from \href{https://baseballsavant.mlb.com/statcast_search}{Baseball Savant}
#'via a search, and subsequently subsetted.
#'
#'@examples
#'summary(pbp2018$release_speed[pbp2018$player_name=="Jacob deGrom" & pbp2018$pitch_type=="FF"])
#'
#'table(pbp2018$player_name, pbp2018$pitch_type)
NULL