get_data_by_id: Get data for a unit by ID

Description Usage Arguments Details Value See Also Examples

Description

These functions return data about events, matches or players by the vector(s) of respective identifiers.

Usage

1
2
3
4
5
6
get_events(event_id = integer(0), sleep_sec = 1, progress = TRUE)

get_matches(event_id = integer(0), round_id = integer(0),
  match_num = integer(0), sleep_sec = 1, progress = TRUE)

get_players(player_id = integer(0), sleep_sec = 1, progress = TRUE)

Arguments

event_id

Vector of event ids in character, integer or numeric form

sleep_sec

Number of seconds to wait before the next query

progress

Boolean indicator of whether to show function progress

round_id

Vector of round ids in character, integer or numeric form

match_num

Vector of match numbers in character, integer or numeric form

player_id

Vector of player ids in character, integer or numeric form

Details

Identifier for event is event_id.

Identifier for match is combination of event_id, round_id and match_num. When using get_matches these vectors are recycled by standard R rules.

Identifier for player is player_id.

If there is no available data for particular identifier then it will not be included in return value (with appropriate message).

sleep_sec is introduced in order to not overload API servers. It can be not less than 1 second. If progress == TRUE text progress will be displayed in the console.

Value

get_events returns event data.frame. Rows are arranged from the latest ended event to the earliest.

get_matches returns match data.frame. Rows are arranged from the latest ended match to the earliest.

get_players returns player data.frame. Column status is filled with NA because there is no information from performed query. Information about player status can be obtained from calls to get_season_pro_players, get_season_ama_players, get_all_players, get_all_pro_players, get_all_ama_players.

See Also

get_data_multiple for querying multiple data for one unit.

get_data_all for querying all data for unit type.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
# Get data about events with IDs 1 and 2
get_events(event_id = 1:2)

# Get data about match in event 398, round 4 and match number 1
get_matches(event_id = 398, round_id = 4, match_num = 1)

# Get data about players with IDs from 1 to 10
get_players(player_id = 1:10)

## End(Not run)

evgeniC/snookerorg documentation built on May 16, 2019, 9:39 a.m.