Title: | Find Common Team Mates For Soccer Players |
---|---|
Description: | Identify a football player's current and former team mates. Find common team-mates for a set of named footballers. Data fetched from <transfermarkt.com>. |
Authors: | Matt Dray [aut, cre] |
Maintainer: | Matt Dray <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.0.9001 |
Built: | 2024-10-16 04:47:08 UTC |
Source: | https://github.com/matt-dray/soccercolleagues |
Get Common Team Mates For Named Players
get_colleagues(all_players, players)
get_colleagues(all_players, players)
all_players |
Data.frame. Data fetched from
Transfermarkt with
|
players |
Character vector. One or more player names for whom to return
common team mates from the |
Pass one player name to the players
argument to fetch all of
their team mates in the dataset. Pass multiple players to return common
team mates and they seasons they played together.
A data.frame with a row per player and season.
## Not run: # Fetch player data from Transfermarkt epl_players <- get_players(1992:2020, "England") # Return all team mate data for one named player get_colleagues(epl_players, "James Milner") # Return data for all team mates in common for named players get_colleagues( epl_players, c("Mark Viduka", "Kevin Phillips", "Nicky Butt") ) ## End(Not run)
## Not run: # Fetch player data from Transfermarkt epl_players <- get_players(1992:2020, "England") # Return all team mate data for one named player get_colleagues(epl_players, "James Milner") # Return data for all team mates in common for named players get_colleagues( epl_players, c("Mark Viduka", "Kevin Phillips", "Nicky Butt") ) ## End(Not run)
Fetch Player Data From Transfermarkt
get_players(seasons = 1992:2021, country = "England")
get_players(seasons = 1992:2021, country = "England")
seasons |
Numeric. One of more season starting-years for which to fetch data from Transfermarkt. Defaults to seasons where the English Premier League has existed (since 1992). |
country |
Character. Country from which to fetch data from
Transfermarkt. Defaults to
|
A data.frame/tibble with a row per player/season and columns for name, position, age, team, year, etc.
## Not run: epl_players <- get_players(1992:2021, "England")
## Not run: epl_players <- get_players(1992:2021, "England")
Open 'Guess The Player' Quiz App
open_colleagues_quiz(all_players)
open_colleagues_quiz(all_players)
all_players |
Data.frame. Data fetched from
Transfermarkt with
|
Opens a Shiny app.
## Not run: # Fetch player data from Transfermarkt epl_players <- get_players(1992:2020, "England") # Open Shiny App open_colleagues_quiz(epl_players) ## End(Not run)
## Not run: # Fetch player data from Transfermarkt epl_players <- get_players(1992:2020, "England") # Open Shiny App open_colleagues_quiz(epl_players) ## End(Not run)
Sample From Named Players' Common Team Mates
sample_colleagues(all_players, players, n = NULL)
sample_colleagues(all_players, players, n = NULL)
all_players |
Data.frame. Data fetched from
Transfermarkt with
|
players |
Character vector. One or more player names for whom to return
common team mates from the |
n |
Numeric. Number of team-mates' names to return. See details. |
Pass one player name to the players
argument to sample from all of
their team mates in the dataset. Pass multiple players to sample from
common team mates.
The default number of player names returned, n
, by will depend on the
number of players supplied to the players
argument: one input name
will result in n = 5
; multiple input names will result in
n = 1
.
A character vector of player names.
## Not run: # Fetch player data from Transfermarkt epl_players <- get_players(1992:2020, "England") # Return several team mates for one named player sample_colleagues(epl_players, "James Milner", n = 5) # Return one team mate in common for named players sample_colleagues( epl_players, c("Mark Viduka", "Kevin Phillips", "Nicky Butt"), n = 1 ) ## End(Not run)
## Not run: # Fetch player data from Transfermarkt epl_players <- get_players(1992:2020, "England") # Return several team mates for one named player sample_colleagues(epl_players, "James Milner", n = 5) # Return one team mate in common for named players sample_colleagues( epl_players, c("Mark Viduka", "Kevin Phillips", "Nicky Butt"), n = 1 ) ## End(Not run)