Description Usage Arguments Details Value Examples
Sample From Named Players' Common Team Mates
1 | 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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.