Skip to content

Instantly share code, notes, and snippets.

@stephenrparsons
stephenrparsons / draft.R
Created August 31, 2014 19:49
Get fantasy football projections and calculate Value Over Replacement for each player
library(XML)
library(plyr)
# get league data
qb <- readHTMLTable("http://www.fantasypros.com/nfl/projections/qb.php", stringsAsFactors = FALSE)$data
rb <- readHTMLTable("http://www.fantasypros.com/nfl/projections/rb.php", stringsAsFactors = FALSE)$data
wr <- readHTMLTable("http://www.fantasypros.com/nfl/projections/wr.php", stringsAsFactors = FALSE)$data
te <- readHTMLTable("http://www.fantasypros.com/nfl/projections/te.php", stringsAsFactors = FALSE)$data
k <- readHTMLTable("http://www.fantasypros.com/nfl/projections/k.php", stringsAsFactors = FALSE)$data
d <- readHTMLTable("http://games.espn.go.com/ffl/tools/projections?leagueId=0&slotCategoryId=16", stringsAsFactors = FALSE)$playertable_0