Downloading NFL.com Fantasy Football Projections using R
1In this post, I will show how to download NFL.com fantasy football projections using R.
The R Script
The R Script for downloading fantasy football projections from NFL.com is located at: https://github.com/FantasyFootballAnalytics/FantasyFootballAnalyticsR/blob/master/R%20Scripts/Projections/NFL%20Projections.R
#Download fantasy football projections from NFL.com
qb1_nfl ("http://fantasy.nfl.com/research/projections?position=1&sort=projectedPts&statCategory=projectedStats&statSeason=2012&statType=seasonProjectedStats", stringsAsFactors = FALSE)$`NULL`
qb2_nfl ("http://fantasy.nfl.com/research/projections?offset=26&position=1&sort=projectedPts&statCategory=projectedStats&statSeason=2012&statType=seasonProjectedStats", stringsAsFactors = FALSE)$`NULL`
rb1_nfl ("http://fantasy.nfl.com/research/projections?position=2&statCategory=projectedStats&statSeason=2012&statType=seasonProjectedStats", stringsAsFactors = FALSE)$`NULL`
rb2_nfl ("http://fantasy.nfl.com/research/projections?offset=26&position=2&sort=projectedPts&statCategory=projectedStats&statSeason=2012&statType=seasonProjectedStats", stringsAsFactors = FALSE)$`NULL`
rb3_nfl ("http://fantasy.nfl.com/research/projections?offset=51&position=2&sort=projectedPts&statCategory=projectedStats&statSeason=2012&statType=seasonProjectedStats", stringsAsFactors = FALSE)$`NULL`
wr1_nfl ("http://fantasy.nfl.com/research/projections?position=3&sort=projectedPts&statCategory=projectedStats&statSeason=2012&statType=seasonProjectedStats", stringsAsFactors = FALSE)$`NULL`
wr2_nfl ("http://fantasy.nfl.com/research/projections?offset=26&position=3&sort=projectedPts&statCategory=projectedStats&statSeason=2012&statType=seasonProjectedStats", stringsAsFactors = FALSE)$`NULL`
wr3_nfl ("http://fantasy.nfl.com/research/projections?offset=51&position=3&sort=projectedPts&statCategory=projectedStats&statSeason=2012&statType=seasonProjectedStats", stringsAsFactors = FALSE)$`NULL`
te_nfl ("http://fantasy.nfl.com/research/projections?position=4&statCategory=projectedStats&statSeason=2012&statType=seasonProjectedStats", stringsAsFactors = FALSE)$`NULL`
Here’s a density plot of the NFL.com projections:
ggplot(projections_nfl, aes(x=pts_nfl), fill=pos) + geom_density(fill="green", alpha=.3) + xlab("Player's Projected Points") + ggtitle("Density Plot of NFL.com Projected Points from 2012")
Share










[…] to download, calculate, and compare fantasy football projections from ESPN, CBS, NFL.com, and FantasyPros, which aggregates projections from many different sources to increase prediction […]