Click the Original, Code and Reconstruction tabs to read about the issues and how they were fixed.
Objective
The object of this visualization is to compare the cost of 1GB mobile data in 155 different countries and jurisdictions all around the globe. It is shocking to know how vastly different all different countries and jurisdictions are even in the 21st century when everyone has internet at the tip of their fingers. It can be due to various factors i.e the saturation of the market, the number of competitors and other economic factors.
The target audience of this visualisation is the general public living all around the globe who wants to compare the cost of their countries mobile data with other countries and rank. It can also be a potential visualisation for an investor planning to invest in the telecommunication industry around the globe and want to compare the data plans all around the world.
The visualisation chosen had the following three main issues:
Other small issues that were also identified are:
RMIT IEEE referencing style is used to refer the sources.
Reference
The following code was used to fix the issues identified in the original. Things that are fixed are:
library(tmap)
library(htmlwidgets)
library(htmltools)
library(leaflet)
data("World")
MobileDataCost = read.csv('MobileDataCost.csv')
merged_MobileDataCost = merge(World, MobileDataCost, by.x = 'name', by.y='Country')
tmap_mode("view")
map <- tm_shape(merged_MobileDataCost) +
tm_borders(lwd = 1) +
tm_polygons(col = "Average_Price_of_1GB_in_USD",
palette=c('#bfbca6', '#fee090','#d73027', '#72001a', '#313695'),
colorNA = "darkgrey",
breaks = c(0.09, 0.47, 0.52, 0.80, 1.1, 2.220, 3.748, 4.540, 8.328, 13.87, 27.42),
title="Average Price of 1GB data (USD)",
popup.vars = c("Average Price of 1GB data (USD) = " = "Average_Price_of_1GB_in_USD",
"World ranking for cheapest data rate = "="Rank"),) +
tm_style("col_blind") + tm_legend(text.size=0.1,title.size=0.1) +
tm_view(view.legend.position=c("left", "bottom"), control.position=c("right", "bottom"))
tag.map.title <- tags$style(HTML("
.leaflet-control.map-title {
transform: translate(-50%,20%);
position: fixed !important;
left: 50%;
text-align: center;
padding-left: 10px;
padding-right: 10px;
background: rgba(255,255,255,0.75);
font-weight: bold;
font-size: 16px;
}
"))
tag.map.otherlegend <- tags$style(HTML("
.leaflet-control.map-otherlegend {
transform: translate(-50%,20%);
position: fixed !important;
left: 26.2%;
top: 49%;
text-align: left;
padding-left: 10px;
padding-right: 10px;
background: rgba(255,255,255,0.82);
font-size: 13px;
border-radius: 8px;
}
"))
title <- tags$div(
tag.map.title, HTML("The Cost of 1GB of Mobile Data in Every Country (in USD)")
)
otherlegend <- tags$div(
tag.map.otherlegend, HTML('<table>
<caption style="font-weight: bold; font-size: 14px;">Top Countries</caption>
<tr style="line-height: 13px;">
<td width= 7% style="background-color:#bfbca6; border: 2px solid #bfbca6;"> </td>
<td width= 10%></td>
<td width= 78%>Least Expensive Countries</td>
</tr>
<tr style="line-height: 16px;">
<td width= 7% style="background-color:#313695; border: 2px solid #313695;"> </td>
<td width= 10% ></td>
<td width= 78% >Most Expensive Countries</td>
</tr>
<tr style="line-height: 16px; padding:5px">
<td width= 7% style="color:#ffffff00">. </td>
<td width= 10% style="color:#ffffff00">. </td>
<td width= 78% style="color:#ffffff00">. </td>
</tr>
</table>')
)
leaf_map <- tmap_leaflet(map, add.titles = TRUE) %>%
addTiles() %>%
addControl(title, position = "topleft", className="map-title") %>%
addControl(otherlegend, position = "topleft", className = "map-otherlegend")
RMIT IEEE referencing style is used to refer the sources.
Data Reference
The following plot fixes the main issues in the original.