Skip to contents

This function allows the user to obtain batting or pitching statistics for any school affiliated with the NCAA at the division I, II, or III levels. The function acquires data from the NCAA's website (stats.ncaa.org) and returns a tibble.

Usage

ncaa_scrape(teamid, year, type = "batting")

Arguments

teamid

The numerical ID that the NCAA website uses to identify a team

year

The season for which data should be returned, in the form of "YYYY". Years currently available: 2013-2017.

type

A string indicating whether to return "batting" or "pitching" statistics

Value

A data frame with the following variables

col_nametypes
yearinteger
schoolcharacter
conferencecharacter
divisionnumeric
Jerseycharacter
Playercharacter
Yrcharacter
Poscharacter
GPnumeric
GSnumeric
BAnumeric
OBPctnumeric
SlgPctnumeric
Rnumeric
ABnumeric
Hnumeric
2Bnumeric
3Bnumeric
TBnumeric
HRnumeric
RBInumeric
BBnumeric
HBPnumeric
SFnumeric
SHnumeric
Knumeric
DPnumeric
CSnumeric
Pickednumeric
SBnumeric
RBI2outnumeric
teamidnumeric
conference_idinteger
player_idinteger
player_urlcharacter

Examples

# \donttest{
  try(ncaa_scrape(teamid=255, year=2013, type = "batting"))
#> ── NCAA Baseball Team Stats data from stats.ncaa.org ───────────────────
#>  Data updated: 2022-04-30 07:17:18 UTC
#> # A tibble: 21 × 35
#>     year school      conference division Jersey Player Yr    Pos      GP
#>    <int> <chr>       <chr>         <dbl> <chr>  <chr>  <chr> <chr> <dbl>
#>  1  2013 Georgia Te… ACC               1 9      Murra… So    C        64
#>  2  2013 Georgia Te… ACC               1 10     Evans… Jr    C        64
#>  3  2013 Georgia Te… ACC               1 8      Wren,… Jr    OF       64
#>  4  2013 Georgia Te… ACC               1 3      Hyde,… Jr    INF      64
#>  5  2013 Georgia Te… ACC               1 32     Palka… Jr    1B       62
#>  6  2013 Georgia Te… ACC               1 31     Dove,… Sr    INF      61
#>  7  2013 Georgia Te… ACC               1 14     Gonza… Fr    INF      61
#>  8  2013 Georgia Te… ACC               1 6      Thoma… Sr    OF       53
#>  9  2013 Georgia Te… ACC               1 35     Sping… So    OF       50
#> 10  2013 Georgia Te… ACC               1 13     Smith… So    INF      45
#> # … with 11 more rows, and 26 more variables: GS <dbl>, BA <dbl>,
#> #   OBPct <dbl>, SlgPct <dbl>, R <dbl>, AB <dbl>, H <dbl>, `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>, RBI2out <dbl>, teamid <dbl>, conference_id <int>,
#> #   player_id <int>, player_url <chr>
# }