get_tidy_lineups: Get Tidy Lineups

View source: R/Get Tidy Lineups.R

get_tidy_lineupsR Documentation

Get Tidy Lineups

Description

Takes paths for draftkings contest-standings file, and corresponding salary file. returns a tidy version, where each row corresponds to a player in a lineup.

Note that this will result in a dataframe of length (number of players in a lineup) * (number of lineups), so for larger contests this can result in data sets with 1 million+ rows

Usage

get_tidy_lineups(contest_path, salary_path, sport, contest_id = NULL)

Arguments

contest_path

a path to the contest-standings csv you'd like to tidy up

salary_path

a path to the salary file corresponding to the contest-standing file you are tidying

sport

A string specifying the sport of the contest. tidyDK currently supports 'NFL', 'NHL', 'NBA' and 'MLB'

contest_id

an ID that you'd like to assign to all rows of the file (optional)

Value

tidy data.table with a row for each player in a lineup in a contest, joined with ownership and points scored data for each player

Examples


lineups <- get_tidy_lineups('./contest-standings-1234564789.csv',
                            './DKsalaries.csv', "NFL")
head(lineups)



Dmunslow/tidyDK documentation built on Nov. 8, 2022, 8:53 a.m.