clean_lineup_data: Clean DraftKings 'contest-standings' csv Lineup Data

View source: R/Clean Functions.R

clean_lineup_dataR Documentation

Clean DraftKings 'contest-standings' csv Lineup Data

Description

Takes a draftkings "contest-standings" dataframe with player lineups and returns a tidy version in a "long" format i.e. each row is 1 player corresponding to a lineup id.

Usage

clean_lineup_data(contest_data, sport)

Arguments

contest_data

A dataframe of raw lineup data from a draftings "contest-standings" csv

sport

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

Value

The contest data for all lineups in the 'contest-standings' csv in long format. Returns a data.table object

Examples



lineups <- clean_lineup_data(contest_data, "NFL")
head(lineups)




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