• How To
    • Win Your DFS League
    • Win Your Auction Draft
    • Win Your Snake Draft
    • Download Projections
    • Scrape Projections
    • Calculate Projections for Your League
    • Examine Accuracy of Projections
    • Identify Sleepers
    • Save Custom Settings
    • Use the API
  • Strategy
    • Fantasy Football is Like Stock Picking
    • Use Projections, Not Rankings
  • Projections
    • Our Projections
    • Who has the Best Projections?
    • Draft the Best Starting Lineup
    • Projections are More Accurate than Rankings
    • Points by Position Rank
    • Players’ Risk Levels
    • Value Over Replacement
    • Bid-Up-To Value
    • Player Value Gap
    • Gold Mining
    • Weekly Variability
    • Are Subscription Sources More Accurate?
  • Statistics
    • How To Learn R
    • R is Better than Excel
    • Do Stats Help in Fantasy Football?
    • Download/Run Our Scripts
    • ffanalytics R Package
  • Apps
    • Auction Draft Optimizer
    • Snake Draft Optimizer
    • Weekly Lineup Optimizer
    • Rankings/Projections for Your League
    • API
    • Other Tools
      • Stock Analysis
    • Error Logging
  • Testimonials
  • About the Site
    • About
    • Authors
      • Isaac Petersen
    • FAQ
    • FFA Insider
    • Privacy Policy
    • Terms of Service
  • Donate

Fantasy Football Analytics

Downloading CBS Fantasy Football Projections in R

2
  • by Isaac Petersen
  • in How To · Projections · R
  • — 7 Mar, 2013
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: https://github.com/FantasyFootballAnalytics/FantasyFootballAnalyticsR/blob/master/R%20Scripts/Projections/CBS%20Projections.R
Here are lines of code to download the CBS projections from CBSsports.com:
#Download fantasy football projections from cbssports.com
qb_cbs ("http://fantasynews.cbssports.com/fantasyfootball/stats/weeklyprojections/QB/season", stringsAsFactors = FALSE)[7]$'NULL'
rb1_cbs ("http://fantasynews.cbssports.com/fantasyfootball/stats/weeklyprojections/RB/season", stringsAsFactors = FALSE)[7]$'NULL'
rb2_cbs ("http://fantasynews.cbssports.com/fantasyfootball/stats/weeklyprojections/RB/season?&start_row=51", stringsAsFactors = FALSE)[7]$'NULL'
wr1_cbs ("http://fantasynews.cbssports.com/fantasyfootball/stats/weeklyprojections/WR/season", stringsAsFactors = FALSE)[7]$'NULL'
wr2_cbs ("http://fantasynews.cbssports.com/fantasyfootball/stats/weeklyprojections/WR/season?&start_row=51", stringsAsFactors = FALSE)[7]$'NULL'
te_cbs ("http://fantasynews.cbssports.com/fantasyfootball/stats/weeklyprojections/TE/season", 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 NFL.com fantasy football projections using R.

Share this:

  • Click to share on X (Opens in new window) X
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to email a link to a friend (Opens in new window) Email

Like this:

Like Loading...

Related

Share

Tags: CBSR

— Isaac Petersen

My name is Isaac and I'm an assistant professor with a Ph.D. in Clinical Psychology. Why am I writing about fantasy football and data analysis? Because fantasy football involves the intersection of two things I love: sports and statistics. With this site, I hope to demonstrate the relevance of statistics for choosing the best team in fantasy football.

2 Comments

  1. Jarrod says:
    October 4, 2016 at 5:55 pm

    Hey Isaac. I am completely novice to R and programming. I have wanted to create my own fantasy football software so that I can play with different aspects of game play. I have a couple of computer science buddies to build the software but I am wondering about where to pull the data from. This post shows how to pull the data for projections. What I will need is real time data during games to pull data from what is happening. Do you have any idea where CBS, ESPN, etc. get their data? So Julio catches a pass and everyone’s league stats are automatically updated. Are they all pulling from a common source? Thanks so much.

    Reply
    • Val Pinskiy says:
      October 7, 2016 at 1:00 pm

      A lot of the bigger companies use Stats LLC or a similar provider but that type of data is out of our scope at this point.

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • Previous story Download Fantasy Football Projections from ESPN.com using R
  • Next story Downloading NFL.com Fantasy Football Projections using R
  • Tabs

    • Most Popular
    • Recent Posts
    • The ffanalytics R Package for Fantasy Football Data AnalysisJune 18, 2016
    • 2015 Fantasy Football Projections using OpenCPUMay 28, 2015
    • Win Your Fantasy Football Auction Draft: Determine the Optimal Players to Draft with this AppJune 14, 2013
    • Win Your Fantasy Football Snake Draft with this AppSeptember 1, 2013
    • Post-Combine Mock: Team Needs and TargetsMarch 10, 2025
    • Fantasy Football Weekly Cheat Sheet: Week 18 (2024)January 3, 2025
    • Fantasy Football Weekly Cheat Sheet: Week 17 (2024)December 26, 2024
    • Fantasy Football Weekly Cheat Sheet: Week 16 (2024)December 18, 2024
  • FFA Insider

    Logo
  • Categories

    • About the Authors
    • Articles
    • Auction Drafts
    • Draft Optimizer
    • FFA Insider
    • Gold Mining
    • How To
    • In the Media
    • Luck
    • Package
    • Projections
    • R
    • Risk
    • Theory
    • Tools
    • Trade Strategy
    • Uncategorized
    • Weekly
  • Facebook

  • Twitter

  • Our Partners

    R-bloggers

  • Support us building things... Even a cup of coffee ($1.99) helps us stay awake!

  • Subscribe to the Fantasy Football Analytics mailing list (no spam).
    Loading

        © Fantasy Football Analytics

        %d