Returns top players ranked by their most recent ELO rating.
Requires local database with player_elo_history table.
Usage
rank_players(
rating_type = "batting",
match_type = "t20",
top_n = 10,
db_path = NULL
)
Arguments
- rating_type
Character. "batting" or "bowling"
- match_type
Character. "all" for overall, or specific format: "t20", "odi", "test"
- top_n
Integer. Number of players to return (default 10)
- db_path
Character. Database path. If NULL, uses default.
Value
Data frame with columns: rank, player_id, elo_rating, last_match_date
Examples
if (FALSE) { # \dontrun{
# Top 10 batters overall
top_batters <- rank_players("batting", top_n = 10)
# Top 20 T20 bowlers
top_t20_bowlers <- rank_players("bowling", match_type = "t20", top_n = 20)
} # }