Learn R Programming

baseballr (version 1.3.0)

ncaa_scrape: Scrape NCAA baseball data (Division I, II, and III)

Description

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")

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

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

Examples

Run this code
# \donttest{
  try(ncaa_scrape(teamid=255, year=2013, type = "batting"))
# }

Run the code above in your browser using DataLab