Downloading CBS Fantasy Football Projections in R

March 6, 2013

(This article was first published on Fantasy Football Analytics in R, and kindly contributed to R-bloggers)

In this post, I will show how to download CBS fantasy football projections using R.

The R Script

The R Script for downloading fantasy football projections from CBS is located at:

Here are lines of code to download the CBS projections from
#Download fantasy football projections from
qb_cbs <- readHTMLTable("", stringsAsFactors = FALSE)[7]$'NULL'
rb1_cbs <- readHTMLTable("", stringsAsFactors = FALSE)[7]$'NULL'
rb2_cbs <- readHTMLTable("", stringsAsFactors = FALSE)[7]$'NULL'
wr1_cbs <- readHTMLTable("", stringsAsFactors = FALSE)[7]$'NULL'
wr2_cbs <- readHTMLTable("", stringsAsFactors = FALSE)[7]$'NULL'
te_cbs <- readHTMLTable("", stringsAsFactors = FALSE)[7]$'NULL'
Here’s a density plot of the CBS projections:
ggplot(projections_cbs, aes(x=pts_cbs)) + geom_density(fill="red", alpha=.3) + xlab("Player's Projected Points") + ggtitle("Density Plot of CBS Projected Points from 2012")

In my next post, I will show how to download fantasy football projections using R.

To leave a comment for the author, please follow the link and comment on their blog: Fantasy Football Analytics in R. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.


Mango solutions

RStudio homepage

Zero Inflated Models and Generalized Linear Mixed Models with R

Dommino data lab

Quantide: statistical consulting and training



CRC R books series

Six Sigma Online Training

Contact us if you wish to help support R-bloggers, and place your banner here.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)