<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/2018-update-of-ffanalytics-r-package/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://fantasyfootballanalytics.net/2018/08/2018-update-ffanalytics-r-package.html"> R – Fantasy Football Analytics</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<h2>Introduction</h2>
<p>As part of our effort to provide users ways to replicate our analyses and improve their performance in fantasy football, we are continuously looking at ways we can improve our tools. Since the <a rel="nofollow" href="https://fantasyfootballanalytics.net/2016/06/ffanalytics-r-package-fantasy-football-data-analysis.html" target="_blank"><code>ffanalytics</code> package</a> was introduced back in 2016, we have had a tremendous response and feedback on the package and have worked through some of the kinks and are now introducing a new version of the <code>ffanalytics</code> package that should be more robust and provide more consistent results.</p>
<h2>Improvements</h2>
<p>One of the major concerns with data scrapes is that websites change and so does the way data are rendered on individual pages. Where the old version of the <code>ffanalytics</code> package was highly dependent on how columns were ordered on the different sites, the new version of the package does not depend on column order. Instead the package looks for specific components of the page and, based on predefined mapping, can determine which columns are which.</p>
<p>The other major concern is that different sites lists the same player with a slightly different name (i.e. Rob Kelly or Robert Kelly) or at different positions, so matching up the data can be tricky. The new version of the package maps player IDs from the different sites back to the player ID used by MyFantasyLeague.com, so it now doesn’t matter what name or position a specific player is listed as on a specific site because the data for a specific player will match up correctly.</p>
<p>Finally, the new version of the package relies heavily on the vocabulary and terminology used in the <a rel="nofollow" href="https://www.tidyverse.org/" target="_blank"><code>tidyverse</code></a> package.  We highly recommend familiarizing yourself with that package.</p>
<p>It is our intent that the new version of the package will provide more consistent scrapes for users.</p>
<h2>Player information</h2>
<p>The player information used in the package is based on player information from MyFantasyLeague.com (MFL). When the package is loaded, it pulls the most recent player data from MFL into the <code>player_table</code> object. When the scrape runs, it determines the player ID for the player on the site that is being scraped and maps that ID back to the MFL player ID. The scraped data contains an <code>id</code> column which holds the player ID for MFL, and a <code>src_id</code> column that has the ID for the site. However, when aggregating the stats and generating the projections the player ID used is the MFL player ID.</p>
<h2>Custom calculations</h2>
<p>The customization of calculations is done as input to the <code>projections_table()</code> function. You can specify your own scoring rules, analyst weights, tier thresholds and VOR baselines to be used in the calculations. See <code>?projections_table</code> for specifics, and check out the <code>scoring_settings</code> vignette on how to customize scoring rules</p>
<h2>Installation and getting started</h2>
<p>We have updated the instructions on installing and getting the package <a rel="nofollow" href="https://fantasyfootballanalytics.net/2016/06/ffanalytics-r-package-fantasy-football-data-analysis.html" target="_blank">here</a> so you can check that page out, and feel free to leave comments with feedback and suggestions.</p>
<p>The post <a rel="nofollow" href="https://fantasyfootballanalytics.net/2018/08/2018-update-ffanalytics-r-package.html" target="_blank">2018 Update of ffanalytics R Package</a> appeared first on <a rel="nofollow" href="https://fantasyfootballanalytics.net/" target="_blank">Fantasy Football Analytics</a>.</p>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="https://fantasyfootballanalytics.net/2018/08/2018-update-ffanalytics-r-package.html"> R – Fantasy Football Analytics</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img width="1" alt="" src="http://feeds.feedburner.com/~r/RBloggers/~4/dj_Y5Mb-J4M" height="1"></a></div>