Skip to contents

Get NCAA Baseball Game Logs

Usage

ncaa_game_logs(player_id, year, type = "batting", span = "game", ...)

Arguments

player_id

A player's unique id. Can be found using the get_ncaa_baseball_roster function.

year

The year of interest.

type

The kind of statistics you want to return. Current options are 'batting' or 'pitching'.

span

The span of time; can either be 'game' for game logs in a season, or 'career' which returns seasonal stats for a player's career.

...

Additional arguments passed to an underlying function like httr.

Value

A data frame containing player and school information as well as game by game statistics

col_nametypes
player_idnumeric
player_namecharacter
Datecharacter
Opponentcharacter
Resultcharacter
Appnumeric
Gnumeric
GSnumeric
IPnumeric
CGnumeric
Hnumeric
Rnumeric
ERnumeric
BBnumeric
SOnumeric
SHOnumeric
BFnumeric
P-OABnumeric
2B-Anumeric
3B-Anumeric
Bknumeric
HR-Anumeric
WPnumeric
HBnumeric
IBBnumeric
Inh Runnumeric
Inh Run Scorenumeric
SHAnumeric
SFAnumeric
Pitchesnumeric
GOnumeric
FOnumeric
Wnumeric
Lnumeric
SVnumeric
OrdAppearednumeric
KLnumeric
pickoffscharacter

Examples

# \donttest{
  try(ncaa_game_logs(player_id = 2649785, year = 2023, type = "pitching", span = "game"))
#> ── NCAA Baseball Game Logs data from stats.ncaa.org ────────────────────
#>  Data updated: 2024-04-13 21:57:04 UTC
#> # A tibble: 71 × 39
#>    player_id player_name   Date  Opponent Result     G   App    GS    IP
#>        <dbl> <chr>         <chr> <chr>    <chr>  <dbl> <dbl> <dbl> <dbl>
#>  1   2649785 Caglianone, … 02/1… Charles… 13-3       1    NA    NA  NA  
#>  2   2649785 Caglianone, … 02/1… Charles… 16-2       1    NA    NA  NA  
#>  3   2649785 Caglianone, … 02/1… Charles… 8-0        1     1     1   6.2
#>  4   2649785 Caglianone, … 02/2… @ South… 6-1        1    NA    NA  NA  
#>  5   2649785 Caglianone, … 02/2… South F… 9-10       1    NA    NA  NA  
#>  6   2649785 Caglianone, … 02/2… Cincinn… 13-6       1    NA    NA  NA  
#>  7   2649785 Caglianone, … 02/2… Cincinn… 13-3       1    NA    NA  NA  
#>  8   2649785 Caglianone, … 02/2… Cincinn… 13-7       1     1     1   4.2
#>  9   2649785 Caglianone, … 02/2… @ Jacks… 18-8       1    NA    NA  NA  
#> 10   2649785 Caglianone, … 03/0… Jackson… 8-10       1    NA    NA  NA  
#> # ℹ 61 more rows
#> # ℹ 30 more variables: CG <dbl>, H <dbl>, R <dbl>, ER <dbl>, BB <dbl>,
#> #   SO <dbl>, SHO <dbl>, BF <dbl>, `P-OAB` <dbl>, `2B-A` <dbl>,
#> #   `3B-A` <dbl>, Bk <dbl>, `HR-A` <dbl>, WP <dbl>, HB <dbl>,
#> #   IBB <dbl>, `Inh Run` <dbl>, `Inh Run Score` <dbl>, SHA <dbl>,
#> #   SFA <dbl>, Pitches <dbl>, GO <dbl>, FO <dbl>, W <dbl>, L <dbl>,
#> #   SV <dbl>, OrdAppeared <dbl>, KL <dbl>, pickoffs <chr>, Year <dbl>
  try(ncaa_game_logs(player_id = 2477974, year = 2023, type = "pitching", span = "career"))
#> ── NCAA Baseball Game Logs data from stats.ncaa.org ────────────────────
#>  Data updated: 2024-04-13 21:57:08 UTC
#> # A tibble: 4 × 38
#>   Year   player_id player_name Team  GP    G     App   GS    ERA   IP   
#>   <chr>      <dbl> <chr>       <chr> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 2020-…   2477974 Skenes, Pa… Air … 48    48    18    ""    2.70  26.2 
#> 2 2021-…   2477974 Skenes, Pa… Air … 52    52    15    "15"  2.73  85.2 
#> 3 2022-…   2477974 Skenes, Pa… LSU   19    19    19    "19"  1.69  122.2
#> 4 Totals   2477974 Skenes, Pa… Tota… 119   119   52    "34"  2.18  235.0
#> # ℹ 28 more variables: CG <chr>, H <chr>, R <chr>, ER <chr>, BB <chr>,
#> #   SO <chr>, SHO <chr>, BF <chr>, `P-OAB` <chr>, `2B-A` <chr>,
#> #   `3B-A` <chr>, Bk <chr>, `HR-A` <chr>, WP <chr>, HB <chr>,
#> #   IBB <chr>, `Inh Run` <chr>, `Inh Run Score` <chr>, SHA <chr>,
#> #   SFA <chr>, Pitches <chr>, GO <chr>, FO <chr>, W <chr>, L <chr>,
#> #   SV <chr>, KL <chr>, pickoffs <chr>
  try(ncaa_game_logs(player_id = 2680961, year = 2023, type = "batting", span = "game"))
#> ── NCAA Baseball Game Logs data from stats.ncaa.org ────────────────────
#>  Data updated: 2024-04-13 21:57:11 UTC
#> # A tibble: 55 × 26
#>    player_id player_name   Date  Opponent Result     G     R    AB     H
#>        <dbl> <chr>         <chr> <chr>    <chr>  <dbl> <dbl> <dbl> <dbl>
#>  1   2680961 Brethowr, Iv… 02/1… Minneso… 9-7        1     3     4     3
#>  2   2680961 Brethowr, Iv… 02/1… New Mex… 1-3        1    NA     4    NA
#>  3   2680961 Brethowr, Iv… 02/1… Minneso… 13-2       1     2     4     4
#>  4   2680961 Brethowr, Iv… 02/2… Oregon … 0-11       1    NA     3     1
#>  5   2680961 Brethowr, Iv… 02/2… @ Oregon 6-2        1     1     5     2
#>  6   2680961 Brethowr, Iv… 02/2… @ Oregon 10-0       1     1     5     1
#>  7   2680961 Brethowr, Iv… 02/2… @ Oregon 4-1        1     1     4    NA
#>  8   2680961 Brethowr, Iv… 03/0… Xavier   0-2        1    NA     5     2
#>  9   2680961 Brethowr, Iv… 03/0… Xavier   4-2        1    NA     4    NA
#> 10   2680961 Brethowr, Iv… 03/0… Xavier   5-1        1     1     3     1
#> # ℹ 45 more rows
#> # ℹ 17 more variables: `2B` <dbl>, `3B` <dbl>, TB <dbl>, HR <dbl>,
#> #   RBI <dbl>, BB <dbl>, HBP <dbl>, SF <dbl>, SH <dbl>, K <dbl>,
#> #   DP <dbl>, CS <dbl>, Picked <dbl>, SB <dbl>, IBB <dbl>,
#> #   RBI2out <dbl>, Year <dbl>
  try(ncaa_game_logs(player_id = 2486588, year = 2023, type = "batting", span = "career"))
#> ── NCAA Baseball Game Logs data from stats.ncaa.org ────────────────────
#>  Data updated: 2024-04-13 21:57:15 UTC
#> # A tibble: 4 × 27
#>   Year  player_id player_name Team  GP    BA    G     OBPct SlgPct R    
#>   <chr>     <dbl> <chr>       <chr> <chr> <chr> <chr> <chr> <chr>  <chr>
#> 1 2020…   2486588 Crews, Dyl… LSU   63    0.362 63    0.453 0.663  64   
#> 2 2021…   2486588 Crews, Dyl… LSU   62    0.349 62    0.463 0.691  73   
#> 3 2022…   2486588 Crews, Dyl… LSU   71    0.426 71    0.567 0.713  100  
#> 4 Tota…   2486588 Crews, Dyl… Tota… 196   0.380 196   0.498 0.689  237  
#> # ℹ 17 more variables: AB <chr>, H <chr>, `2B` <chr>, `3B` <chr>,
#> #   TB <chr>, HR <chr>, RBI <chr>, BB <chr>, HBP <chr>, SF <chr>,
#> #   SH <chr>, K <chr>, DP <chr>, CS <chr>, Picked <chr>, SB <chr>,
#> #   RBI2out <chr>
# }