<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/create-stylish-tables-in-r-using-formattable/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://www.littlemissdata.com/blog/prettytables"> Little Miss Data</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p><img data-image-dimensions="596x150" data-image-focal-point="0.5,0.5" src="https://i0.wp.com/static1.squarespace.com/static/58eef8846a4963e429687a4d/t/5ba8ff94e2c4833b814d7368/1537802137149/formattable.gif?w=456&ssl=1" alt="formattable.gif" data-load="false" data-type="image" data-image-id="5ba8ff94e2c4833b814d7368" data-recalc-dims="1" data-image="https://static1.squarespace.com/static/58eef8846a4963e429687a4d/t/5ba8ff94e2c4833b814d7368/1537802137149/formattable.gif"></p>
<p>I love a good visualization to assist in telling the story of your data. Because of this I am completely hooked on a variety of data visualization packages and tooling. But what happens with you need to visualize the raw numbers? Do you open up the data set in the viewer and screenshot? Do you save the summarized data set locally and add a bit of formatting in excel? That’s what I used to do with my R summary tables. But it got me thinking; why can’t tables be treated as a first class data visualization too? Tables need a little pizazz as much as the next data object! </p>
<p>Enter the r package <a rel="nofollow" href="https://cran.r-project.org/web/packages/formattable/formattable.pdf" target="_blank">formattable</a>! The formattable package is used to transform vectors and data frames into more readable and impactful tabular formats. </p>
<p>I’m going to walk you through a step-by-step example of using the formattable R package to make your data frame more presentable for data storytelling. </p>
<hr>
<h2>Set Up R</h2>
<p>In terms of setting up the <a rel="nofollow" href="https://www.littlemissdata.com/blog/watsonstudio" target="_blank">R working environment</a>, we have a couple of options open to us.  We can use something like R Studio for a local analytics on our personal computer.  Or we can use a free, hosted, multi-language collaboration environment like Watson Studio<a rel="nofollow" href="https://laura-ellis-s5yb.squarespace.com/blog/highlight#" target="_blank">.</a>  If you’d like to get started with R in IBM Watson Studio, please have a look at the <a rel="nofollow" href="https://www.littlemissdata.com/blog/watsonstudio" target="_blank">tutorial I wrote</a>.  </p>
<hr>
<h2>Install and load packages, Set variables</h2>
<p>R packages contain a grouping of R data functions and code that can be used to perform your analysis. We need to install and load them in your environment so that we can call upon them later.  We are also going to assign a few custom color variables that we will use when setting the colors on our table. If you are in Watson Studio, enter the following code into a cell (or multiple cells), highlight the cell and hit the “run cell”  button. </p>
<pre><code># Install the relevant libraries - do this one time</code></pre>
<pre><code>install.packages(&quot;data.table&quot;)</code></pre>
<pre><code>install.packages(&quot;dplyr&quot;)</code></pre>
<pre><code>install.packages(&quot;formattable&quot;)</code></pre>
<pre><code>install.packages(&quot;tidyr&quot;)</code></pre>
<pre><code></code></pre>
<pre><code>#Load the libraries</code></pre>
<pre><code>library(data.table)</code></pre>
<pre><code>library(dplyr)</code></pre>
<pre><code>library(formattable)</code></pre>
<pre><code>library(tidyr)</code></pre>
<p></p>
<pre><code>#Set a few color variables to make our table more visually appealing</code></pre>
<pre><code>customGreen0 = &quot;#DeF7E9&quot;</code></pre>
<pre><code>customGreen = &quot;#71CA97&quot;</code></pre>
<pre><code>customRed = &quot;#ff7f7f&quot;</code></pre>
<hr>
<h2>Download the Data</h2>
<p>For our tutorial we are going to be using a data set from the <a rel="nofollow" href="https://data.austintexas.gov/" target="_blank">Austin Open Data Portal</a>. It’s a website designed to make facilitate easy access to open government data. I’ve been playing around with it somewhat frequently and I’m really impressed with the consistency of design and features per data set. A lot of other open data portals do not make it this easy to find and download data from. </p>
<p>We are going to be using formattable on the <a rel="nofollow" href="https://data.austintexas.gov/stories/s/b2dw-5rzd" target="_blank">Imagine Austin Indicators</a> dataset. As per the <a rel="nofollow" href="http://www.austintexas.gov/page/imagine-austin-vision" target="_blank">Imagine Austin website</a>, the <a rel="nofollow" href="https://data.austintexas.gov/City-Government/Imagine-Austin-Indicators/apwj-7zty" target="_blank">data set </a>tracks key performance indicators (KPIs) of Austins progress in creating a connected, vibrant and livable city. </p>
<pre><code>#Download the Austin indicator data set</code></pre>
<pre><code>austinData= fread('https://raw.githubusercontent.com/lgellis/MiscTutorial/master/Austin/Imagine_Austin_Indicators.csv', data.table=FALSE, header = TRUE, stringsAsFactors = FALSE)</code></pre>
<pre><code>head(austinData)</code></pre>
<pre><code>attach(austinData)</code></pre>
<p data-rte-preserve-empty="true">
<hr>
<h2>Modify the Data Set </h2>
<p>We are going to narrow down the data set to focus on 4 key health metrics. Specifically the prevalence of obesity, tobacco use, cardiovascular disease and obesity. We are then going to select only the indicator name and yearly KPI value columns. Finally we are going to make extra columns to display the 2011 to 2016 yearly average and the 2011 to 2016 metric improvements. </p>
<pre><code>i1 &lt;- austinData %>%</code></pre>
<pre><code>  filter(`Indicator Name` %in% </code></pre>
<pre><code>           c('Prevalence of Obesity', 'Prevalence of Tobacco Use', </code></pre>
<pre><code>             'Prevalence of Cardiovascular Disease', 'Prevalence of Diabetes')) %>%</code></pre>
<pre><code>  select(c(`Indicator Name`, `2011`, `2012`, `2013`, `2014`, `2015`, `2016`)) %>%</code></pre>
<pre><code>  mutate (Average = round(rowMeans(</code></pre>
<pre><code>    cbind(`2011`, `2012`, `2013`, `2014`, `2015`, `2016`), na.rm=T),2), </code></pre>
<pre><code>    `Improvement` = round((`2011`-`2016`)/`2011`*100,2))</code></pre>
<pre><code>i1</code></pre>
<hr>
<h2>View the table data in it’s raw format</h2>
<p>We now have the data in the table we want, so let’s display it to our audience. We can start by viewing the table in it’s raw format. </p>
<pre><code>i2</code></pre>
<p> </p>
<p> <img data-image-dimensions="1284x172" data-image-focal-point="0.5,0.5" src="https://i1.wp.com/static1.squarespace.com/static/58eef8846a4963e429687a4d/t/5ba850c008522941fe9ef1b6/1537757381609/Screen+Shot+2018-09-23+at+9.49.13+PM.png?w=456&ssl=1" alt="Screen Shot 2018-09-23 at 9.49.13 PM.png" data-load="false" data-type="image" data-image-id="5ba850c008522941fe9ef1b6" data-recalc-dims="1" data-image="https://static1.squarespace.com/static/58eef8846a4963e429687a4d/t/5ba850c008522941fe9ef1b6/1537757381609/Screen+Shot+2018-09-23+at+9.49.13+PM.png"></p>
<p> </p>
<hr>
<h2>View the Data with the Formattable Package</h2>
<p>Viewing the data by simply printing it did not produce a nice looking table. Let’s see what formattable gives us out of the box. </p>
<pre><code>#0) Throw it in the formattable function</code></pre>
<pre><code>formattable(i1)</code></pre>
<p> </p>
<p> <img data-image-dimensions="1626x360" data-image-focal-point="0.5,0.5" src="https://i0.wp.com/static1.squarespace.com/static/58eef8846a4963e429687a4d/t/5ba851b6eef1a16551b66353/1537757627187/i_DataTable0.png?w=456&ssl=1" alt="i_DataTable0.png" data-load="false" data-type="image" data-image-id="5ba851b6eef1a16551b66353" data-recalc-dims="1" data-image="https://static1.squarespace.com/static/58eef8846a4963e429687a4d/t/5ba851b6eef1a16551b66353/1537757627187/i_DataTable0.png"></p>
<p>Not bad! But let’s spruce it up a little. We will left align the first column, right align the last column and center align the rest. Additionally we will bold and make grey the the row title: Indicator Name. </p>
<p data-rte-preserve-empty="true">
<pre><code> #1)  First Data Table</code></pre>
<pre><code>formattable(i1, </code></pre>
<pre><code>            align =c(&quot;l&quot;,&quot;c&quot;,&quot;c&quot;,&quot;c&quot;,&quot;c&quot;, &quot;c&quot;, &quot;c&quot;, &quot;c&quot;, &quot;r&quot;), </code></pre>
<pre><code>            list(`Indicator Name` = formatter(</code></pre>
<pre><code>              &quot;span&quot;, style = ~ style(color = &quot;grey&quot;,font.weight = &quot;bold&quot;)) </code></pre>
<pre><code>))</code></pre>
<p> <img data-image-dimensions="1618x386" data-image-focal-point="0.5,0.5" src="https://i1.wp.com/static1.squarespace.com/static/58eef8846a4963e429687a4d/t/5ba8543324a69414e20407c0/1537758266978/i_datatable1.png?w=456&ssl=1" alt="i_datatable1.png" data-load="false" data-type="image" data-image-id="5ba8543324a69414e20407c0" data-recalc-dims="1" data-image="https://static1.squarespace.com/static/58eef8846a4963e429687a4d/t/5ba8543324a69414e20407c0/1537758266978/i_datatable1.png"></p>
<hr>
<h2>Add a Color Tile for All Year Columns</h2>
<p>We will add the color_tile function to all year columns. This creates the effect of a column by column row wise heat map, and it looks great! Note that we are using our own custom colors declared in the very beginning of the code to ensure our table has the look and feel we want. </p>
<pre><code>#2) Add the color mapping for all 2011 to 2016.</code></pre>
<pre><code>formattable(i1, align =c(&quot;l&quot;,&quot;c&quot;,&quot;c&quot;,&quot;c&quot;,&quot;c&quot;, &quot;c&quot;, &quot;c&quot;, &quot;c&quot;, &quot;r&quot;), list(</code></pre>
<pre><code>  `Indicator Name` = formatter(&quot;span&quot;, style = ~ style(color = &quot;grey&quot;,font.weight = &quot;bold&quot;)), </code></pre>
<pre><code>  `2011`= color_tile(customGreen, customGreen0),</code></pre>
<pre><code>  `2012`= color_tile(customGreen, customGreen0),</code></pre>
<pre><code>  `2013`= color_tile(customGreen, customGreen0),</code></pre>
<pre><code>  `2014`= color_tile(customGreen, customGreen0),</code></pre>
<pre><code>  `2015`= color_tile(customGreen, customGreen0),</code></pre>
<pre><code>  `2016`= color_tile(customGreen, customGreen0)</code></pre>
<pre><code>))</code></pre>
<p> <img data-image-dimensions="811x204" data-image-focal-point="0.5,0.5" src="https://i1.wp.com/static1.squarespace.com/static/58eef8846a4963e429687a4d/t/5ba99ae3e2c483e9c5649e17/1537841895416/i_datatable2.png?w=456&ssl=1" alt="i_datatable2.png" data-load="false" data-type="image" data-image-id="5ba99ae3e2c483e9c5649e17" data-recalc-dims="1" data-image="https://static1.squarespace.com/static/58eef8846a4963e429687a4d/t/5ba99ae3e2c483e9c5649e17/1537841895416/i_datatable2.png"></p>
<hr>
<h2>Add a Color Bar for the Average Column</h2>
<p>We will now add the color_bar function to the average column. Rather than using a heat map, it will display the same background color each time. However, it will have a bar line to indicate relative row wise size of the values. </p>
<pre><code>#3) Add the color bar to the average column</code></pre>
<pre><code>formattable(i1, align =c(&quot;l&quot;,&quot;c&quot;,&quot;c&quot;,&quot;c&quot;,&quot;c&quot;, &quot;c&quot;, &quot;c&quot;, &quot;c&quot;, &quot;r&quot;), list(</code></pre>
<pre><code>  `Indicator Name` = formatter(&quot;span&quot;, style = ~ style(color = &quot;grey&quot;,font.weight = &quot;bold&quot;)), </code></pre>
<pre><code>  `2011`= color_tile(customGreen, customGreen0),</code></pre>
<pre><code>  `2012`= color_tile(customGreen, customGreen0),</code></pre>
<pre><code>  `2013`= color_tile(customGreen, customGreen0),</code></pre>
<pre><code>  `2014`= color_tile(customGreen, customGreen0),</code></pre>
<pre><code>  `2015`= color_tile(customGreen, customGreen0),</code></pre>
<pre><code>  `2016`= color_tile(customGreen, customGreen0),</code></pre>
<pre><code>  `Average` = color_bar(customRed)</code></pre>
<pre><code>))</code></pre>
<p> <img data-image-dimensions="811x204" data-image-focal-point="0.5,0.5" src="https://i1.wp.com/static1.squarespace.com/static/58eef8846a4963e429687a4d/t/5ba99b880d9297259b3cea80/1537842092389/i_datatable3.png?w=456&ssl=1" alt="i_datatable3.png" data-load="false" data-type="image" data-image-id="5ba99b880d9297259b3cea80" data-recalc-dims="1" data-image="https://static1.squarespace.com/static/58eef8846a4963e429687a4d/t/5ba99b880d9297259b3cea80/1537842092389/i_datatable3.png"></p>
<hr>
<h2>Add Our Own Format Function</h2>
<p>One great tip that I learned from the <a rel="nofollow" href="https://cran.r-project.org/web/packages/formattable/vignettes/formattable-data-frame.html" target="_blank">vignette</a> is that you can make your own formatting functions really easily. Using their examples in the vignette and on <a rel="nofollow" href="http://bioinfo.iric.ca/create-a-nice-looking-table-using-r/" target="_blank">bioinfo.irc.ca</a>, I made a slight modification to create our own improvement_formatter function that bolds the text and colors it our custom red or green depending on it’s value.</p>
<pre><code>#4) Add sign formatter to improvement over time

improvement_formatter &lt;- 
  formatter(&quot;span&quot;, 
            style = x ~ style(
              font.weight = &quot;bold&quot;, 
              color = ifelse(x > 0, customGreen, ifelse(x &lt; 0, customRed, &quot;black&quot;))))



formattable(i1, align =c(&quot;l&quot;,&quot;c&quot;,&quot;c&quot;,&quot;c&quot;,&quot;c&quot;, &quot;c&quot;, &quot;c&quot;, &quot;c&quot;, &quot;r&quot;), list(
  `Indicator Name` = 
    formatter(&quot;span&quot;, style = ~ style(color = &quot;grey&quot;,font.weight = &quot;bold&quot;)), 
  `2011`= color_tile(customGreen, customGreen0),
  `2012`= color_tile(customGreen, customGreen0),
  `2013`= color_tile(customGreen, customGreen0),
  `2014`= color_tile(customGreen, customGreen0),
  `2015`= color_tile(customGreen, customGreen0),
  `2016`= color_tile(customGreen, customGreen0),
  `Average` = color_bar(customRed),
  `Improvement` = improvement_formatter
))</code></pre>
<p> <img data-image-dimensions="811x204" data-image-focal-point="0.5,0.5" src="https://i2.wp.com/static1.squarespace.com/static/58eef8846a4963e429687a4d/t/5ba99f59e79c70221c836c92/1537843037694/i_datatable4.png?w=456&ssl=1" alt="i_datatable4.png" data-load="false" data-type="image" data-image-id="5ba99f59e79c70221c836c92" data-recalc-dims="1" data-image="https://static1.squarespace.com/static/58eef8846a4963e429687a4d/t/5ba99f59e79c70221c836c92/1537843037694/i_datatable4.png"></p>
<hr>
<h2>Modify the Format Function To Display Images</h2>
<p>We are going to slightly modify the format to display the up and down arrow depending on the value of improvement. Note, that in the video above, I also change the formatter to display a thumbs up symbol on the winning improvement value. The code for this and other examples are available on <a rel="nofollow" href="https://github.com/lgellis/MiscTutorial/tree/master/Austin" target="_blank">my github repo.</a> </p>
<pre><code>#5) For improvement formatter add icons</code></pre>
<pre><code># Up and down arrow with greater than comparison from the vignette</code></pre>
<pre><code>improvement_formatter &lt;- formatter(&quot;span&quot;, </code></pre>
<pre><code>                                   style = x ~ style(font.weight = &quot;bold&quot;, </code></pre>
<pre><code>                                                     color = ifelse(x > 0, customGreen, ifelse(x &lt; 0, customRed, &quot;black&quot;))), </code></pre>
<pre><code>                                   x ~ icontext(ifelse(x>0, &quot;arrow-up&quot;, &quot;arrow-down&quot;), x)</code></pre>
<pre><code>                                   )</code></pre>
<pre><code>formattable(i1, align =c(&quot;l&quot;,&quot;c&quot;,&quot;c&quot;,&quot;c&quot;,&quot;c&quot;, &quot;c&quot;, &quot;c&quot;, &quot;c&quot;, &quot;r&quot;), list(</code></pre>
<pre><code>  `Indicator Name` = formatter(&quot;span&quot;, style = ~ style(color = &quot;grey&quot;,font.weight = &quot;bold&quot;)), </code></pre>
<pre><code>  `2011`= color_tile(customGreen, customGreen0),</code></pre>
<pre><code>  `2012`= color_tile(customGreen, customGreen0),</code></pre>
<pre><code>  `2013`= color_tile(customGreen, customGreen0),</code></pre>
<pre><code>  `2014`= color_tile(customGreen, customGreen0),</code></pre>
<pre><code>  `2015`= color_tile(customGreen, customGreen0),</code></pre>
<pre><code>  `2016`= color_tile(customGreen, customGreen0),</code></pre>
<pre><code>  `Average` = color_bar(customRed),</code></pre>
<pre><code>  `Improvement` = improvement_formatter</code></pre>
<pre><code>))</code></pre>
<p> <img data-image-dimensions="811x204" data-image-focal-point="0.5,0.5" src="https://i1.wp.com/static1.squarespace.com/static/58eef8846a4963e429687a4d/t/5ba9a0c3f9619a770c1b01c0/1537843399381/i_datatable5.png?w=456&ssl=1" alt="i_datatable5.png" data-load="false" data-type="image" data-image-id="5ba9a0c3f9619a770c1b01c0" data-recalc-dims="1" data-image="https://static1.squarespace.com/static/58eef8846a4963e429687a4d/t/5ba9a0c3f9619a770c1b01c0/1537843399381/i_datatable5.png"></p>
<hr>
<h2>Add an Icon in The Row Title Based on the Value in Another Column</h2>
<p>We are going to make one last modification to append an image to the indicator name column based on a value located in another column. This is an important departure from our previous behavior, because previously we were only assigning the format of a single column based on it’s own values. In order to enable cross column compare, we just need to remove the x in front of the ~ style and the ~ icontext conditions. This will allow us to explicitly specify the columns we want to reference. </p>
<pre><code>#6) Add a star to the max value.  Use  if/else value = max(value)</code></pre>
<pre><code>improvement_formatter &lt;- formatter(&quot;span&quot;, </code></pre>
<pre><code>                                   style = x ~ style(font.weight = &quot;bold&quot;, </code></pre>
<pre><code>                                                     color = ifelse(x > 0, customGreen, ifelse(x &lt; 0, customRed, &quot;black&quot;))), </code></pre>
<pre><code>                                   x ~ icontext(ifelse(x == max(x), &quot;thumbs-up&quot;, &quot;&quot;), x)</code></pre>
<pre><code>)</code></pre>
<pre><code>## Based on Name</code></pre>
<pre><code>formattable(i1, align =c(&quot;l&quot;,&quot;c&quot;,&quot;c&quot;,&quot;c&quot;,&quot;c&quot;, &quot;c&quot;, &quot;c&quot;, &quot;c&quot;, &quot;r&quot;), list(</code></pre>
<pre><code>  `Indicator Name` = formatter(&quot;span&quot;,</code></pre>
<pre><code>                     style = x ~ style(color = &quot;gray&quot;),</code></pre>
<pre><code>                     x ~ icontext(ifelse(x == &quot;Prevalence of Tobacco Use&quot;, &quot;star&quot;, &quot;&quot;), x)), </code></pre>
<pre><code>  `2011`= color_tile(customGreen, customGreen0),</code></pre>
<pre><code>  `2012`= color_tile(customGreen, customGreen0),</code></pre>
<pre><code>  `2013`= color_tile(customGreen, customGreen0),</code></pre>
<pre><code>  `2014`= color_tile(customGreen, customGreen0),</code></pre>
<pre><code>  `2015`= color_tile(customGreen, customGreen0),</code></pre>
<pre><code>  `2016`= color_tile(customGreen, customGreen0),</code></pre>
<pre><code>  `Average` = color_bar(customRed),</code></pre>
<pre><code>  `Improvement` = improvement_formatter</code></pre>
<pre><code>))</code></pre>
<p> <img data-image-dimensions="811x204" data-image-focal-point="0.5,0.5" src="https://i2.wp.com/static1.squarespace.com/static/58eef8846a4963e429687a4d/t/5ba9a280c83025b36780abda/1537843843752/i_datatable7.png?w=456&ssl=1" alt="i_datatable7.png" data-load="false" data-type="image" data-image-id="5ba9a280c83025b36780abda" data-recalc-dims="1" data-image="https://static1.squarespace.com/static/58eef8846a4963e429687a4d/t/5ba9a280c83025b36780abda/1537843843752/i_datatable7.png"></p>
<p> </p>
<hr>
<h2>Compare Column to Column</h2>
<p>Finally, we are going to just do a simple cross column row wise comparison. We’ll take our same data set but strip it back to just 2015 and 2016 data. We will then compare the values and mark up the 2016 column as up/down and green/red based on comparing the 2016 value to the 2015 value.</p>
<pre><code>##7)  Compare column to column</code></pre>
<pre><code>#Drop the rest and show just 2015 and 2016</code></pre>
<pre><code>i2 &lt;- austinData %>%</code></pre>
<pre><code>  filter(`Indicator Name` %in% c('Prevalence of Obesity', 'Prevalence of Tobacco Use', 'Prevalence of Cardiovascular Disease', 'Prevalence of Diabetes')) %>%</code></pre>
<pre><code>  select(c(`Indicator Name`, `2015`, `2016`)) </code></pre>
<pre><code>head(i2)</code></pre>
<pre><code>formattable(i2, align =c(&quot;l&quot;,&quot;c&quot;,&quot;c&quot;), list(</code></pre>
<pre><code>  `Indicator Name` = formatter(&quot;span&quot;,</code></pre>
<pre><code>                               style = ~ style(color = &quot;gray&quot;)), </code></pre>
<pre><code>  `2016`= formatter(&quot;span&quot;, style = ~ style(color = ifelse(`2016` >`2015`, &quot;red&quot;, &quot;green&quot;)),</code></pre>
<pre><code>                    ~ icontext(ifelse(`2016` >`2015`,&quot;arrow-up&quot;, &quot;arrow-down&quot;), `2016`))</code></pre>
<pre><code>))</code></pre>
<p> <img data-image-dimensions="877x204" data-image-focal-point="0.5,0.5" src="https://i2.wp.com/static1.squarespace.com/static/58eef8846a4963e429687a4d/t/5ba9a3c7e2c483e9c565055b/1537844171274/i_datatable_2col.png?w=456&ssl=1" alt="i_datatable_2col.png" data-load="false" data-type="image" data-image-id="5ba9a3c7e2c483e9c565055b" data-recalc-dims="1" data-image="https://static1.squarespace.com/static/58eef8846a4963e429687a4d/t/5ba9a3c7e2c483e9c565055b/1537844171274/i_datatable_2col.png"></p>
<hr>
<h2>Extras</h2>
<p>In the full <a rel="nofollow" href="https://github.com/lgellis/MiscTutorial/tree/master/Austin" target="_blank">github code</a>, you will see a number of other examples. As a bonus, I’ve also included the code to create the animation using the<a rel="nofollow" href="https://cran.r-project.org/web/packages/magick/vignettes/intro.html" target="_blank"> magick package</a>!</p>
<hr>
<h2>Thank You</h2>
<p>Thanks for reading along while we explored the <a rel="nofollow" href="https://github.com/renkun-ken/formattable" target="_blank">formattable package.</a>  Please share your thoughts and creations with me on <a rel="nofollow" href="https://twitter.com/LittleMissData" target="_blank">twitter</a>. </p>
<p>Note that the full code is available on my <a rel="nofollow" href="https://github.com/lgellis/MiscTutorial/tree/master/Austin" target="_blank"> github repo</a><a rel="nofollow" href="https://github.com/lgellis/MiscTutorial/tree/master/Heatmap" target="_blank">.</a>  If you have trouble downloading the file from github, go to the <a rel="nofollow" href="https://github.com/lgellis/MiscTutorial" target="_blank">main page of the repo</a> and select “Clone or Download” and then “Download Zip”.</p>
<p> </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.littlemissdata.com/blog/prettytables"> Little Miss Data</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/pEQMw8sgIhI" height="1"></a></div>