Learn R Programming

baseballr (version 1.5.0)

ncaa_game_logs: Get NCAA Baseball Game Logs

Description

Get NCAA Baseball Game Logs

Usage

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

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

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.

Examples

Run this code
# \donttest{
  try(ncaa_game_logs(player_id = 2113782, year = 2021, type = "pitching", span = "game"))
  try(ncaa_game_logs(player_id = 2113782, year = 2021, type = "pitching", span = "career"))
  try(ncaa_game_logs(player_id = 1879650, year = 2019, type = "batting", span = "game"))
  try(ncaa_game_logs(player_id = 1879650, year = 2019, type = "batting", span = "career"))
# }

Run the code above in your browser using DataLab