<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="https://www.r-bloggers.com/love-is-all-around-popular-words-in-pop-hits/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://blog.revolutionanalytics.com/2017/05/love-is-all-around.html"> Revolutions</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<div>
<p>Data scientist Giora Simchoni recently published a fantastic analysis of the history of pop songs on the <a target="_blank" rel="nofollow" href="http://www.billboard.com/charts/hot-100">Billboard Hot 100</a> using the <a target="_blank" rel="nofollow" href="https://mran.microsoft.com/documents/what-is-r/">R language</a>. Giora used the <a target="_blank" rel="nofollow" href="https://mran.microsoft.com/package/rvest/">rvest package</a> in R to scrape data from the <a target="_blank" rel="nofollow" href="http://www.umdmusic.com/">Ultimate Music Database</a> site for the 350,000 chart entries (and 35,000 unique songs) since 1940, and used those data to create and visualize several measures of song popularity over time.</p>
<p>A novel measure that Giora calculates is &quot;area under the song curve&quot;: the sum of all the ranks above 100 for every week the song is in the Hot 100. By that measure, the most popular (and also longest-charting) song of all time is <a target="_blank" rel="nofollow" href="https://www.youtube.com/watch?v=ktvTqknDobU">Radioactive by Imagine Dragons</a>:</p>
<p><a target="_blank" rel="nofollow" href="http://giorasimchoni.com/2017/05/22/2017-05-22-billboard-bananas/"><img title="Imagine Dragons" alt="Imagine Dragons" src="http://revolution-computing.typepad.com/.a/6a010534b1db25970b01b8d286201b970c-800wi" border="0"></a></p>
<p>It's turns out that calculating this &quot;song integral&quot; is pretty simple in R when you use the <a target="_blank" rel="nofollow" href="http://tidyverse.org/">tidyverse</a>:</p>
<div>
<pre>calculateSongIntegral <span>&lt;-</span> <span>function</span>(positions) {
  sum(<span>100</span> <span>-</span> positions)
}

billboard <span>%>%</span>
  filter(EntryDate <span>>=</span> date_decimal(<span>1960</span>)) <span>%>%</span>
  group_by(Artist, Title) <span>%>%</span>
  summarise(positions <span>=</span> list(ThisWeekPosition)) <span>%>%</span>
  mutate(integral <span>=</span> map_dbl(positions, calculateSongIntegral)) <span>%>%</span>
  group_by(Artist, Title) <span>%>%</span>
  tally(integral) <span>%>%</span>
  arrange(<span>-</span>n)
</pre>
</div>
<p>Another fascinating chart included in Giora's post is this analysis of the most frequent words to appear in song titles, by decade. He used the <a target="_blank" rel="nofollow" href="https://mran.microsoft.com/package/tidytext/">tidytext package</a> to extract individual words from song titles and then rank them by frequency of use:</p>
<p><a target="_blank" rel="nofollow" href="http://giorasimchoni.com/2017/05/22/2017-05-22-billboard-bananas/"><img title="Songwords" alt="Songwords" src="http://revolution-computing.typepad.com/.a/6a010534b1db25970b01b8d2861fa0970c-800wi" border="0"></a></p>
<p>So it seems as though <a target="_blank" rel="nofollow" href="https://www.youtube.com/watch?v=h3gEkwhdXUE">Love Is All Around</a> (#41, October 1994) after all! For more analysis of the Billboard Hot 100 data, including Top-10 rankings for various measures of song popularity and the associated R code, check out Giora's post linked below.</p>
<p>Sex, Drugs and Data: <a target="_blank" rel="nofollow" href="http://giorasimchoni.com/2017/05/22/2017-05-22-billboard-bananas/">Billboard Bananas</a></p>
</div>
<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://blog.revolutionanalytics.com/2017/05/love-is-all-around.html"> Revolutions</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 title="The R Project for Statistical Computing" rel="nofollow" href="https://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="https://www.r-bloggers.com/search/data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="https://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="https://www.r-bloggers.com/search/map">maps</a>, <a title="Animation in R" rel="nofollow" href="https://www.r-bloggers.com/search/animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="https://www.r-bloggers.com/search/sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="https://www.r-bloggers.com/search/SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="https://www.r-bloggers.com/search/git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="https://www.r-bloggers.com/search/hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="https://www.r-bloggers.com/search/PCA">PCA</a>, <a title="Time series" rel="nofollow" href="https://www.r-bloggers.com/search/time+series">time series</a>, <a title="finance trading" rel="nofollow" href="https://www.r-bloggers.com/search/trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/2O6qLBT4hwY"></a></div>