search_gids: Search the internal game_id data set.

Description Usage Arguments Examples

Description

Search the internal game_id data set.

Usage

1
2
search_gids(team = NULL, start = NULL, end = NULL, venue = NULL,
  game_type = NULL, home_only = FALSE, away_only = FALSE, ...)

Arguments

team

A team name, or character vector of team names, without the city, as found in the team_ids data set.

start

A start date passed as a character in ISO 8601 format. "2017-05-01"

end

An end date passed as a character in ISO 8601 format. "2017-09-01"

venue

The stadium at which the game(s) were played, as found in the venue_ids data set.

game_type

The type of game(s), as found in the game_ids data set. Typical options include "r" (regular), "w" (world series), "l" (league playoffs), "d" (division playoffs), and "s" (spring training).

home_only

Logical. Collect only home games. The default is FALSE.

away_only

Logical. Collect only away games. The default is FALSE.

...

additional arguments

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# Collect all of the regular season games for the 2016 Cleveland Indians.
game_ids <- search_gids(team = "indians", start = "2016-01-01", end = "2016-12-31", game_type = "r")
head(game_ids)

## Not run: 
# Collect all games from the 2016 World Series
game_ids <- search_gids(start = "2016-10-25", end = "2016-11-02", game_type = "w")

# Collect all regular season games played at Wrigley Field since 2008.
game_ids <- search_gids(venue = "Wrigley Field")

# Fuzzy search results work too.
game_ids <- search_gids(venue = "Wrigley")


## End(Not run)

mlbgameday documentation built on May 2, 2019, 3:21 a.m.