<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/icon-web-icons-for-rmarkdown/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://ropensci.org/technotes/2018/05/15/icon/"> rOpenSci - open tools for open science</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<h1>Icons in R <img align="right" src="https://i2.wp.com/i.imgur.com/YTJIhij.png?w=456&ssl=1" data-recalc-dims="1"></h1>
<p>The <a rel="nofollow" href="https://github.com/ropenscilabs/icon" target="_blank">icon</a> package provides a convenient interface for adding icons from popular web fonts to R Markdown documents. The project began at <a rel="nofollow" href="https://ozunconf17.ropensci.org/" target="_blank">rOpenSci OzUnconf 2017</a>, and was developed by <a rel="nofollow" href="https://github.com/mitchelloharawild" target="_blank">Mitchell O’Hara-Wild</a>, <a rel="nofollow" href="https://github.com/earowang" target="_blank">Earo Wang</a> and <a rel="nofollow" href="https://github.com/timothyhyndman" target="_blank">Timothy Hyndman</a>. The package currently supports icons from <a rel="nofollow" href="https://fontawesome.com/" target="_blank">Font Awesome</a>, <a rel="nofollow" href="http://jpswalsh.github.io/academicons/" target="_blank">Academicons</a>, and <a rel="nofollow" href="http://ionicons.com/" target="_blank">ionicons</a>.</p>
<p>Icons can be added to your R Markdown documents using short prefixes which identify the font’s library.</p>
<ul>
<li>fa: Font Awesome</li>
<li>ai: Academicons</li>
<li>ii: ionicons</li>
</ul>
<p>For example, <code>`r  icon::fa(&quot;rocket&quot;)`</code> can be used to add the <a rel="nofollow" href="https://fontawesome.com/icons/rocket" target="_blank">rocket icon</a> from Font Awesome. This interface is convenient if you are familiar with the icon you want, or if you are dynamically selecting your icon.</p>
<p>The package also provides a second interface which allows for tab completion of font names. To include the rocket icon above, you could instead use <code>`r  icon::fa_rocket()`</code>. This is a useful interface for if you are unfamiliar with the available icons or their names.</p>
<p>Each icon function also provides support for modifying the attributes of the icon such as size, colour, rotation, and animation. We can make the rocket icon spin using <code>`r  icon::fa_rocket(animate = &quot;spin&quot;)`</code>.</p>
<h1>R in icons</h1>
<p>The long-awaited <a rel="nofollow" href="http://cran.r-project.org/logo.html" target="_blank">R Project icon</a> has been added to the Font Awesome library in version 5.0.11. This addition comes nearly four years since the icon’s <a rel="nofollow" href="https://github.com/FortAwesome/Font-Awesome/issues/3862" target="_blank">first request</a> after being brought into the spotlight of <a rel="nofollow" href="https://twitter.com/hashtag/rstats" target="_blank">#rstats</a> with <a rel="nofollow" href="https://twitter.com/LockeData" target="_blank">LockeData</a>’s tweet.</p>
<blockquote class="twitter-tweet">
<p lang="en" dir="ltr">Hey, the <a rel="nofollow" href="https://twitter.com/hashtag/rstats?src=hash&ref_src=twsrc%5Etfw" target="_blank">#rstats</a> logo is #40 on the <a rel="nofollow" href="https://twitter.com/fontawesome?ref_src=twsrc%5Etfw" target="_blank">@fontawesome</a> brand board – go give it some <img alt="👍" src="https://s.w.org/images/core/emoji/2.4/72x72/1f44d.png" class="wp-smiley"> so we can get it higher!<a rel="nofollow" href="https://t.co/jdEcVMJyip" target="_blank">https://t.co/jdEcVMJyip</a></p>
<p>— Locke Data (@LockeData) <a rel="nofollow" href="https://twitter.com/LockeData/status/987286302721806337?ref_src=twsrc%5Etfw" target="_blank">April 20, 2018</a></p></blockquote>
<p>
</p>
<p>Finally, it is possible to use an R package to include the R icon in your R Markdown documents!</p>
<p><code>`r  fa_rocket(colour = &quot;#1FA67A&quot;)`</code> + <code>`r  fa_r_project(colour = &quot;#384CB7&quot;)`</code> = <code>`r  fa_heart(colour = &quot;red&quot;)`</code><br>
<img align="center" src="https://i2.wp.com/i.imgur.com/WImIaGx.png?w=456&ssl=1" data-recalc-dims="1"></p>
<h1>Future development</h1>
<p>There are plans to submit the icon package to CRAN, however there are a few things we would like to work on first. The top development priority is transitioning from web-font icons to svg icons. This should drastically reduce the load times of documents using icons, and allow the user to import their own icon libraries. Before release, we would also like to add further support for manipulating icons with modifier functions, and resolve an R Markdown issue relating to <a rel="nofollow" href="https://github.com/ropenscilabs/icon/issues/7" target="_blank">using icons within headers</a>.</p>
<p>You can install and try out the latest version of the <code>icon</code> package today via:</p>
<pre><code>devtools::install_github(&quot;ropenscilabs/icon&quot;)
</code></pre>
	<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://ropensci.org/technotes/2018/05/15/icon/"> rOpenSci - open tools for open science</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/THPC9AkmIR4" height="1"></a></div>