Coral Bleaching Analysis Visualisation — Tableau or R ggplot?
By: Kieran Tan Kah Wang
Tags: Tableau, Data Analysis, Data Science, R, Data Visualization

Coral Bleaching Analysis Visualisation — Tableau or R ggplot?

Comparing the effectiveness of Tableau and R ggplot to deliver the key messages in Coral Bleaching Analysis

Photo by Bawah Reserve on Unsplash

Tableau and R are two common data visualisation tools where the former is known for it’s simple and beginner-friendly functions, and the latter for it’s extensive user interaction possibilities. How do we decide which visualisation tool is easier to implement or more effective in conveying the key insights to the relevant stakeholders? This article will look into this, and hopefully arrive at a common consensus for all.

Dataset

The dataset we will be using contains Coral Bleaching percentages located in Great Barrier Reef from 2010 to 2017. There’s a total of 5 different coral types, mainly Blue Corals, Hard Corals, Sea Fans, Sea Pens and Soft Corals. 8 different sites/locations along with their latitudes and longitudes situated in Great Barrier Reef has been provided.

Image by author — R output of first 6 records in dataset

Key Message

In every data visualisation we build, there must be a key message we wish to deliver to the relevant stakeholders so that appropriate actions can be taken as supported by these data insights. In this dataset, we wish to address the following questions:

1. In which year and which type of coral bleaching was the worst from 2010 to 2017? 2. How does the location of the site affects bleaching on the different coral types?

Tableau Visualisation

After identifying the key messages we wished to deliver through our data visualisation, we can either begin playing with the types of visualisations available to see which ones will deliver the messages more effectively, or we can use more formal approaches like Five Design Sheet (FDS) Methodology which I’ve previously written here to design visualisations that cater better to the needs. One thing I liked about Tableau is the ease of building different visualisations in just a matter of few drags and drops.

For our first key message, since we are trying to identify a time period (i.e. which year) and a particular type (i.e. type of coral bleaching), we can use a coloured bar charts where the x-axis can be our year period, y-axis be our measure (i.e. percentage of bleaching) and the third dimension of colours to represent the type of corals.

Image by author — Tableau Visualisation for first key message

Through this visualisation, we know the following:

For Year 2010, blue corals had the worst average bleaching at 34.90%.

For Year 2011, sea pens had the worst average bleaching at 35.733%.

For Year 2012, blue corals had the worst average bleaching at 37.546%.

For Year 2013, sea pens had the worst average bleaching at 36.666%.

For Year 2014, hard corals had the worst average bleaching at 43.621%.

For Year 2015, hard corals had the worst average bleaching at 48.030%.

For Year 2016, hard corals had the worst average bleaching at 55.239%.

For Year 2017, sea pens had the worst average bleaching at 62.826%.

Now, let’s try to deliver insights for our second key message. Since we need to identify how each coral site affects the percentage of bleaching, we can visualise it using a map together with the latitudes and longitudes provided.

Image by author — Tableau Visualisation for second key message

Note that we were only able to plot a 2 dimensions visualisation (i.e. size of circle on map for percentage of bleaching and colour of circle to represent different sites) resulting in a total of 5 map plotted to represent our third dimension, the coral type. Through this visualisation, we can infer the following:

For blue corals, the worst average bleaching occurred at Site 01 at 54.666% while Site 03 were affected the least at 16.221%.

For sea fans, the worst average bleaching occurred at Site 03 at 54.541% while Site 06 were affected the least at 8.977%.

For hard corals, the worst average bleaching occurred at Site 01 at 67.533% while Site 04 were affected the least at 11.044%.

For soft corals, the worst average bleaching occurred at Site 01 at 35.377% while Site 08 were affected the least at 15.385%.

For sea pens, the worst average bleaching occurred at Site 03 at 58.559% while Site 06 were affected the least at 30.493%.

R ggplot Visualisation

Building a visualisation in R ggplot is less straightforward and less beginner-friendly as coding is now involved. Whereas, it allows more visualisation possibilities as users get to customized the type of graphs they want. Let’s try to build a single visualisation in R ggplot that can answer both key messages at once.

# load library

library (ggplot2) # read data into R

coral_data<-read.csv("data.csv")

# rename the headers in data

names(coral_data)<-c("year","type","site","bleaching","longtitude","latitude")

# change the column "bleaching" to numeric form instead of % form

coral_data$bleaching<-as.numeric(sub("%","",coral_data$bleaching)) # plot the graph

p<-ggplot(coral_data,aes(year,bleaching)) +

geom_point(aes(shape=type,color=type)) +

facet_grid(type~latitude+site,labeller=label_context) # adding smoother of polynomial type

q<-p+

geom_smooth(method="lm",color="black",size=0.2,formula=y~poly(x,2),se=FALSE) # adding theme to polynomial smoother graph

r<-q+

theme_bw()+

ylab('% of bleaching')+

xlab('Year')+

theme(legend.position = "bottom", legend.direction = "horizontal") r

Image by author — R ggplot visualisation for both key messages

We have plotted a multi-panel (facet-grid) with the two key dimensions of year period in the x-axis and percentage of bleaching as the y-axis. Coral type, the third dimension was added using colours. The multi-panel allows us to introduce a fourth dimension, the location of the site.

For our first key message, we are able to roughly identify the type of coral that had the worst bleaching percentage in each year. Of course, we aren’t able to describe the average bleaching percentage as per our first Tableau visualisation.

For our second key message, we are also able to roughly identify which coral type had the worst bleaching percentage in each site. Similarly, we aren’t able to describe the average bleaching percentage as per our second Tableau visualisation.

Final Thoughts

We have plotted two different visualisations in two different tools. Definitely, there are pros and cons in using each tool, and if I’m to choose which tool is able to better convey the key messages across to the stakeholders, the winner has to be Tableau. Even though we had to build two separate visualisations to deliver the key messages individually, Tableau was able to describe the percentages which I feel is vital when we deliver insights to stakeholders, as they are supported by numbers. R ggplot on the other hand was an easy one page overview of both key messages at once, but unfortunately, only able to roughly identify the key messages roughly after scrutinizing the charts in details. Of course, there’s 101 different possibilities to this dataset in Tableau and R ggplot, and perhaps my way was not the most effective to bring out the best of each tool. Whereas, I hope this article is able to give you guys another perspective to think about when it comes to deciding between which visualisation tool to use for your problem statement/key message, cheers data visualisation enthusiasts!