<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/how-we-use-emojis/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://www.statworx.com/de/blog/how-we-use-emojis/"> r-bloggers – STATWORX</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>Once upon a time, we at <a rel="nofollow" href="https://www.statworx.com/" target="_blank">STATWORX</a> used Slack just as a messenger, but than everything changed when emojis came… Since then, we use them for all kinds of purposes. For example we take polls with them to see were we will eat lunch or we capture unforgettable moments by creating new emojis. The possibilities are limitless! But since we use them so much, I was wondering how often do we use them. And when? And which is the top-emoji?! Is it just the <em>thumbsup</em>?</p>
<p>To answer all these questions, I went on a little journey troughout my emotions. </p>
<h2>Getting the data</h2>
<p>The first part was to gather data. Well, since nearly every tool has a log history this was quite simple. I just had to get the history (the last year) of our Slack channels which was provided within JSONS. These I could easily load into R with the <code>jsonlite</code> package. To get a list of all possible emojis, I found <a rel="nofollow" href="https://github.com/iamcal/emoji-data/blob/master/categories.json" target="_blank">this list</a> from Cal Henderson who works at Slack. I added our own custom emojis to complete the list.</p>
<p>All that followed, was a little loop to go through each message and its reactions and count the occurences of each emoji. Combined with the timestamp given in seconds from January the first in 1970, I had my emoji time series data that looked like this:</p>
<pre><code lang="R">                     EMOJI COUNT     TIME     TYPE       DATE
1: :slightly_smiling_face:     1 08:56:05  message 2018-08-10
2: :slightly_smiling_face:     1 17:08:19  message 2018-08-10
3:                  :gift:     2 08:36:04 reaction 2018-08-18
4:                   :joy:     1 13:47:10 reaction 2018-09-03
5:                    :+1:     1 13:56:12 reaction 2018-09-04
</code></pre>
<p>After evaluating each single text I found that more than every second chat (57%) either has an emoji in the messasge or as a reaction. So we really use them a lot! </p>
<h2>The right timing</h2>
<p>Since the majority was used as a reaction, I summed them up and did not distinguish between messages and reactions. To get a first idea of how often and when we use emojis I looked at a frequency plot over time. There are two things to notice: First, we see an increase over time. Well our company grew, so more people equals more emojis. Second, we tent to not use them during the weekend – how would have thought!?</p>
<p><img alt="emoji-over-year" src="https://i2.wp.com/www.statworx.com/wp-content/uploads/emoji-over-year.png?w=450&ssl=1" class="wp-image-15531" data-recalc-dims="1"></p>
<p>But what about our daily usage? Well there seem to be some peaks. One peak appears right after wake up time, another one when we arrive at the office. Here we can distinguish between colleagues with the mobil app and the ones that <em>just</em> use Slack with the desktop app. There is another peak around our lunchbreak and it comes all to end before we go to bed at 22:00.</p>
<p><img alt="emoji-over-day" src="https://i2.wp.com/www.statworx.com/wp-content/uploads/emoji-over-day.png?w=450&ssl=1" class="wp-image-15528" data-recalc-dims="1"></p>
<h2>Cause and effect</h2>
<p>Since I started this little project, more and more questions popped into my head. For example: Is there a link between the emoji's usage within a message and as a reaction? Are there words, that trigger us to use emojis? To answer the first questions, I used the <code>networkD3</code> package to plot the interaction as a sankey diagram.</p>
<p><img alt="emoji-sankey-category" src="https://i0.wp.com/www.statworx.com/wp-content/uploads/emoji-sankey-category.png?w=450&ssl=1" class="wp-image-15565" data-recalc-dims="1"></p>
<p>Here we can see which categories of emojis used within a message lead to which reactions. The most commonly used category is <strong>Smileys &amp; People</strong> followed by <strong>custom</strong>. And around 40% stay within the same category. </p>
<p>To answer the second question I made some <a rel="nofollow" href="https://www.statworx.com/blog/furchtlose-grammatiker-textmining-im-tidyverse/" target="_blank">wordclouds</a> to see which words we use. The ones in orange are those where a reaction followed. </p>
<p><img src="https://i0.wp.com/www.statworx.com/wp-content/uploads/wordcloud.png?resize=400%2C300&ssl=1" alt="wordcloud" width="400" class="wp-image-15543" data-recalc-dims="1" height="300"></p>
<p>We can see, that we use more words with no emoji reaction than the other way around. If we only look at the ones with emoji reactions, then we get the following picture.</p>
<p><img src="https://i2.wp.com/www.statworx.com/wp-content/uploads/wordcloud-emoji.png?resize=400%2C300&ssl=1" alt="wordcloud-emoji" width="400" class="wp-image-15534" data-recalc-dims="1" height="300"></p>
<p>Seems that if we ask a question &quot;heute wer mal bitte …&quot; (<em>&quot;today someone please…&quot;</em>), we get an reaction – mostly positive.</p>
<h2>The most common emojis</h2>
<p><img alt="emoji-category" src="https://i0.wp.com/www.statworx.com/wp-content/uploads/emoji-category.png?w=450&ssl=1" class="wp-image-15525" data-recalc-dims="1"></p>
<p>As we can see in the plot above, we use the emoji's categories differently. First of all, <strong>Smileys and People</strong> are used the most. But if we look at the emoji density – which represents the percentage of unique used emoji wihtin this category – we only use a third of them. On the other hand, nearly 80% of our custom emojis were used.</p>
<p>To find the most commonly used emojis I looked at the top 50 emojis within messages and reactions. Also I stumbled upon two R packages (<code>emoGG</code> and <code>emojifont</code>) which let you add emojis to your <code>ggplots</code>. This sounded wonderful, but there was a catch! Since we work with RStudio on a Mac I could not use the RStudio plotting device, since it would not show the emojis. After a little bit of research, I found <a rel="nofollow" href="https://stackoverflow.com/questions/47730589/plot-emojis-emoticons-in-r-with-ggplot" target="_blank">this post here</a>, which suggested to use <code>quartz()</code> and <code>grid.export</code> with <code>.svg</code> for the plotting. The loaded font obviously did not have our own emojis, so I just added them as<img alt="❓" src="https://s.w.org/images/core/emoji/2.4/72x72/2753.png" class="wp-smiley">.</p>
<p><img alt="emoji-plot" src="https://i1.wp.com/www.statworx.com/wp-content/uploads/emoji-plot.png?w=450&ssl=1" class="wp-image-15549" data-recalc-dims="1"></p>
<p>So, as I thought in the beginning our top emoji is <img alt="👍" src="https://s.w.org/images/core/emoji/2.4/72x72/1f44d.png" class="wp-smiley">, followed by <img alt="😂" src="https://s.w.org/images/core/emoji/2.4/72x72/1f602.png" class="wp-smiley"> and <img alt="😄" src="https://s.w.org/images/core/emoji/2.4/72x72/1f604.png" class="wp-smiley">.</p>
<figure>
<table>
<thead>
<tr>
<th>Emoji</th>
<th>message</th>
<th>as reaction</th>
<th>total</th>
</tr>
</thead>
<tbody>
<tr>
<td><img alt="👍" src="https://s.w.org/images/core/emoji/2.4/72x72/1f44d.png" class="wp-smiley"></td>
<td>0</td>
<td>482</td>
<td>482</td>
</tr>
<tr>
<td><img alt="😂" src="https://s.w.org/images/core/emoji/2.4/72x72/1f602.png" class="wp-smiley"></td>
<td>98</td>
<td>281</td>
<td>379</td>
</tr>
<tr>
<td><img alt="😄" src="https://s.w.org/images/core/emoji/2.4/72x72/1f604.png" class="wp-smiley"></td>
<td>260</td>
<td>49</td>
<td>309</td>
</tr>
</tbody>
</table>
</figure>
<p>But since there is a lot going on in the lower left corner – let's have a closer look! We can see a variety of emojis beeing used with a lot of custom ones.</p>
<p><img alt="emoji-plotdetails" src="https://i1.wp.com/www.statworx.com/wp-content/uploads/emoji-plotdetails.png?w=450&ssl=1" class="wp-image-15552" data-recalc-dims="1"></p>
<p>With this package, we can also update the plot showing our daily usage with the most commonly used one at the time.</p>
<p><img alt="emoji-over-day-with-icon" src="https://i1.wp.com/www.statworx.com/wp-content/uploads/emoji-over-day-with-icon.png?w=450&ssl=1" class="wp-image-15546" data-recalc-dims="1"></p>
<h2>Conclusion</h2>
<p>With this little project I just scratched the surface of possibilities to analyse the usage of emojis. If you have more ideas, I would like to see your approach and solutions. Just send me an email at <a rel="nofollow" href="mailto:blog@statworx.com" target="_blank">blog@statworx.com</a>. To get started you can use my code at our <a rel="nofollow" href="https://github.com/STATWORX/blog/tree/master/slackemoji" target="_blank">GitHub</a> – not containing our whole data of course, but with an example folder with two jsons. Here you can add your own Slack history.</p>
<h2>References</h2>
<ul>
<li>list of emojis<br>
<a rel="nofollow" href="https://raw.githubusercontent.com/iamcal/emoji-data/master/categories.json" target="_blank">https://raw.githubusercontent.com/iamcal/emoji-data/master/categories.json</a></li>
<li>emojifont package<br>
<a rel="nofollow" href="https://mran.microsoft.com/snapshot/2016-07-03/web/packages/emojifont/vignettes/emojifont.html" target="_blank">https://mran.microsoft.com/snapshot/2016-07-03/web/packages/emojifont/vignettes/emojifont.html</a></li>
<li>emoGG package<br>
<a rel="nofollow" href="https://github.com/dill/emoGG" target="_blank">https://github.com/dill/emoGG</a></li>
</ul>
<div>
<h6>Über den Autor</h6>
<p><img src="https://i1.wp.com/www.statworx.com/wp-content/uploads/jakob-1-300x300.jpg?resize=180%2C180&ssl=1" width="180" alt="Jakob Gepp" class="wp-user-avatar wp-user-avatar-180" data-recalc-dims="1" height="180"></p>
<div>
<h4>Jakob Gepp</h4>
<p>Jakob ist im Statistik Team und interessiert sich im Moment stark für Hadoop und Big Data. In seiner Freizeit bastelt er gerne an alten Elektrogeräten und spielt Hockey.</p>
</div>
</div>
<p>Der Beitrag <a rel="nofollow" href="https://www.statworx.com/de/blog/how-we-use-emojis/" target="_blank">How we use emojis</a> erschien zuerst auf <a rel="nofollow" href="https://www.statworx.com/de/" target="_blank">STATWORX</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://www.statworx.com/de/blog/how-we-use-emojis/"> r-bloggers – STATWORX</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/GUwAhj1v5D4" height="1"></a></div>