
Scrape MiLB game logs for pitchers from FanGraphs
Source:R/fg_milb_pitcher_game_logs.R
fg_milb_pitcher_game_logs.RdThis function allows you to scrape MiLB game logs for individual batters from FanGraphs.com.
Arguments
- playerid
The pitcher's minor league ID from FanGraphs.com.
- year
The season for which game logs should be returned.
Value
Returns a tibble of Minor League pitcher game logs.
| col_name | types |
| player_name | character |
| minor_playerid | character |
| Date | character |
| Team | character |
| Level | character |
| Opp | character |
| W | numeric |
| L | numeric |
| ERA | numeric |
| G | numeric |
| GS | numeric |
| CG | numeric |
| ShO | numeric |
| SV | numeric |
| IP | numeric |
| TBF | numeric |
| H | numeric |
| R | numeric |
| ER | numeric |
| HR | numeric |
| BB | numeric |
| IBB | numeric |
| HBP | numeric |
| WP | numeric |
| BK | numeric |
| SO | numeric |
| K/9 | numeric |
| BB/9 | numeric |
| K/BB | numeric |
| HR/9 | numeric |
| K% | numeric |
| K-BB% | numeric |
| BB% | numeric |
| AVG | numeric |
| WHIP | numeric |
| BABIP | numeric |
| LOB% | numeric |
| FIP | numeric |
| gamedate | character |
| dh | integer |
| UPId | character |
| MLBAMId | character |
| MinorMasterId | character |
| RRId | character |
| FirstName | character |
| LastName | character |
| firstLastName | character |
| Height | character |
| Weight | character |
| BirthDate | character |
| Bats | character |
| Throws | character |
| Position | character |
| BirthCity | character |
| College | character |
| Age | character |
Examples
# \donttest{
try(fg_milb_pitcher_game_logs(playerid = "sa3020682", year=2023))
#> ── MiLB Pitcher Game Logs data from FanGraphs.com ─── baseballr 1.6.0 ──
#> ℹ Data updated: 2024-04-13 21:55:05 UTC
#> # A tibble: 20 × 58
#> player_name minor_playerid Date Team Level Opp W L ERA
#> <chr> <chr> <chr> <chr> <chr> <chr> <dbl> <dbl> <dbl>
#> 1 Chase Hampt… sa3020682 2023… NYY (AA) COL 0 0 0
#> 2 Chase Hampt… sa3020682 2023… NYY (AA) @PHI 1 0 3
#> 3 Chase Hampt… sa3020682 2023… NYY (AA) NYM 0 1 11.2
#> 4 Chase Hampt… sa3020682 2023… NYY (AA) @CLE 0 1 3.6
#> 5 Chase Hampt… sa3020682 2023… NYY (AA) BAL 0 0 7.2
#> 6 Chase Hampt… sa3020682 2023… NYY (AA) @COL 0 0 5.14
#> 7 Chase Hampt… sa3020682 2023… NYY (AA) @NYM 1 0 3.38
#> 8 Chase Hampt… sa3020682 2023… NYY (AA) PHI 0 0 3.6
#> 9 Chase Hampt… sa3020682 2023… NYY (AA) @BAL 0 0 7.94
#> 10 Chase Hampt… sa3020682 2023… NYY (AA) TOR 0 0 1.59
#> 11 Chase Hampt… sa3020682 2023… NYY (AA) PIT 0 0 3
#> 12 Chase Hampt… sa3020682 2023… NYY (A+) @PHI 1 0 0
#> 13 Chase Hampt… sa3020682 2023… NYY (A+) BAL 0 0 2.57
#> 14 Chase Hampt… sa3020682 2023… NYY (A+) @WSN 0 0 3.38
#> 15 Chase Hampt… sa3020682 2023… NYY (A+) NYM 0 1 3.38
#> 16 Chase Hampt… sa3020682 2023… NYY (A+) @BAL 1 0 0
#> 17 Chase Hampt… sa3020682 2023… NYY (A+) WSN 0 0 1.8
#> 18 Chase Hampt… sa3020682 2023… NYY (A+) @BOS 0 0 9.64
#> 19 Chase Hampt… sa3020682 2023… NYY (A+) @ATL 0 0 3.86
#> 20 Chase Hampt… sa3020682 2023… NYY (A+) BAL 0 0 0
#> # ℹ 49 more variables: G <dbl>, GS <dbl>, QS <dbl>, CG <dbl>,
#> # ShO <dbl>, SV <dbl>, IP <dbl>, TBF <dbl>, H <dbl>, R <dbl>,
#> # ER <dbl>, HR <dbl>, BB <dbl>, IBB <dbl>, HBP <dbl>, WP <dbl>,
#> # BK <dbl>, SO <dbl>, `K/9` <dbl>, `BB/9` <dbl>, `K/BB` <dbl>,
#> # `HR/9` <dbl>, `K%` <dbl>, `K-BB%` <dbl>, `BB%` <dbl>, AVG <dbl>,
#> # WHIP <dbl>, BABIP <dbl>, `LOB%` <dbl>, FIP <dbl>, gamedate <chr>,
#> # dh <int>, UPId <chr>, MLBAMId <chr>, MinorMasterId <chr>, …
# }