<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/the-cost-of-true-love-a-k-a-the-tidy-and-expensive-twelve-days-of-christmas/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://rud.is/b/2017/12/05/the-cost-of-true-love-a-k-a-the-tidy-and-expensive-twelve-days-of-christmas/"> R – rud.is</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p><img data-orig-file="https://i1.wp.com/rud.is/b/wp-content/uploads/2017/12/pnc_price_index-1.png?fit=2112%2C1728&amp;ssl=1" data-orig-size="2112,1728" data-medium-file="https://i1.wp.com/rud.is/b/wp-content/uploads/2017/12/pnc_price_index-1.png?fit=300%2C245&amp;ssl=1" data-attachment-id="7426" data-image-meta="{" data-image-description="" src="https://i1.wp.com/rud.is/b/wp-content/uploads/2017/12/pnc_price_index-1.png?resize=780%2C638&ssl=1" data-permalink="https://rud.is/b/2017/12/05/the-cost-of-true-love-a-k-a-the-tidy-and-expensive-twelve-days-of-christmas/pnc_price_index-1/" data-large-file="https://i1.wp.com/rud.is/b/wp-content/uploads/2017/12/pnc_price_index-1.png?fit=530%2C434&amp;ssl=1" alt="pnc_price_index-1" data-image-title="pnc_price_index-1" width="450" data-comments-opened="1" class="wp-image-7426" data-recalc-dims="1"></p>
<p>I’m in the market for Christmas presents for <em>my</em> true love, <a rel="nofollow" href="http://twitter.com/mrshrbrmstr" target="_blank">@mrshrbrmstr</a>, and thought I’d look to an age-old shopping list for inspiration. Just what would it set me back if I decided to mimic the 12 Days of Christmas in this modern day and age?</p>
<p>Let’s try to do the whole thing in R (of course!).</p>
<p>We’ll need to:</p>
<ul>
<li>Grab the lyrics</li>
<li>Parse the lyrics</li>
<li>Get pricing data</li>
<li>Compute some statistics</li>
<li>Make some (hopefully) pretty charts</li>
</ul>
<p>This one was complex enough formatting-wise that I needed to iframe it below. Feel free to <a rel="nofollow" href="https://rud.is/rpubs/twelvedays/" target="_blank">bust out of the iframe</a> at any time.</p>
<p>Some good follow-ups to this (if you’re so inclined) would be to predict prices next year and/or clean up the charts a bit.</p>
<p>Grab the code up on <a rel="nofollow" href="https://github.com/hrbrmstr/twelvedays" target="_blank">GitHub</a>.</p>
<p>(Note: ColourLovers API times out occasionally so just try that snippet again if you get an error).</p>
<p><iframe src="https://rud.is/rpubs/twelvedays/index.html"></iframe></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://rud.is/b/2017/12/05/the-cost-of-true-love-a-k-a-the-tidy-and-expensive-twelve-days-of-christmas/"> R – rud.is</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 alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/FXR9gi1_6aA" height="1"></a></div>