Skip to contents

Typically you will not have to use this function explicitly, but it can be used to build on top of the fantasy package.

Usage

team(players, captain, vc, bank, transfers, chips)

Arguments

players

a numeric vector of length 15 indicating 15 player IDs

captain

a numeric value indicating the ID of the team's captain

vc

a numeric value indicating the ID of the team's vice-captain

bank

a numeric value indicating the teams remaining balance (in FPL£m)

transfers

an integer indicating the number of free transfers a team has remaining

chips

a named logical vector of length 4, indicating the availability of each chip. TRUE indicates the chip has not been used and is available. FALSE indicates that the chip is being used for the current gameweek. NA indicates the chip is not available to use (i.e. has been used earlier in the season).

Value

a tibble with class <team>

Details

This function takes in 15 player IDs and a captain/vice-captain designation, enriches this into a tibble with information on each player, then validates this against a set of criteria to ensure the selected 15 is valid. It then returns the enriched tibble as an object of class team.