Objective
The graph shows the greenhouse gas emissions in percentages that are issued from the major consumption emissions sectors (purchases related to housing, transportation, goods & services and food)- Household Consumption Inventory in Minneapolis city in 2010. The target audience is Minneapolis residents, where this visualization contributes to raising their awareness of their global impact on greenhouse gases.
The chosen visualization has three main issues as follows:
Reference
The following code was used to fix the issues identified in the original.
library(ggplot2)
# The original data table was used to creat data frame
D1 <- data.frame(Var1 = c("Household Consumption", "Household Consumption", "Household Consumption", "Household Consumption"),
Var2 = c("Housing", "Transportation", "Good & Services", "Food and Beverages"),
Percent= c(30.3,29.2,25.1,15.3))
D2 <- data.frame(Var1 = c("Housing", "Housing", "Housing", "Housing", "Housing", "Transportation", "Transportation", "Transportation", "Transportation", "Good & Services", "Good & Services", "Good & Services", "Food and Beverages", "Food and Beverages", "Food and Beverages", "Food and Beverages", "Food and Beverages"),
Var2 = c("Electrccity", "Natural Gas", "Furniture", "Construction", "Water", "Car Fuel", "Air Travel", "Car MFG", "Public Transit", "Services", "Other Goods", "Clothing", "Meat", "Other Food", "Dairy", "Cereals", "Produce"),
Percent= c(10.5,8.7,4.6,3.8,2.7,22.3,4.2,2.5,0.2,14.1,6.8,4.2,6.0,3.3,2.3,1.9,1.8))
D1$Var1<-paste("1.",D1$Var1)
D1$Var2<-paste("2.",D1$Var2)
D2$Var1<-paste("2.",D2$Var1)
D2$Var2<-paste("3.",D2$Var2)
# rbind() function was used to combine the data frames by rows
Household_Consumption<-rbind(D1,D2)
library(googleVis)
#Generate HTML Sankey diagram
HC <- gvisSankey(Household_Consumption[,c('Var1','Var2','Percent')],
options=list(height=600, width=800,
title='Emission breakdown from major sectors - Housing Counsumption Inventory',
sankey = paste0("{
iterations: 0,
link: { colorMode: 'source',
colors: ['lightgray','papayawhip','lightgray','lightgray',
'lightgray'] }
}")),
options(gvis.plot.tag='chart') # options was used to drag the Sankei chart to R
)
Data Reference
The following plot fixes the main issues in the original.