Click the Original, Code and Reconstruction tabs to read about the issues and how they were fixed.
Objective
The data visualisation aims to explore and explain the factors what people from different countries and cultures believes to be most important for making their lives meaningful. The factors that are icluded in this visualisation are family and children, friends, spouses and romantic partner, carreer, and also faith.
This academic visualization presents a unique opportunity for learners from various demographics like students, researchers or policymaker to gain essential insights into cultures’ value systems worldwide. With a focus on discovering what influences people’s happiness levels positively or negatively, it sheds light on different societies providing comparative analysis for better understanding.
The visualisation chosen had the following three main issues:
Reference
Farivar, M. (2023). Where do people find meaning in life? plotset. Retrieved April 25, 2023, from https://plotset.com/gallery/4822bc93-97ce-4f11-8533-b4a1f7114e82?utm_source=reddit&utm_medium=cpc&utm_campaign=reddit_life_masoud&utm_id=reddit_life_masoud
Mitchell, T. (2022, March 22). What makes life meaningful? Views from 17 advanced economies. Pew Research Center’s Global Attitudes Project. Retrieved April 25, 2023, from https://www.pewresearch.org/global/2021/11/18/what-makes-life-meaningful-views-from-17-advanced-economies/
The following code was used to fix the issues identified in the original.
# import libraries
library(ggplot2)
library(readr)
library(tidyr)
library(scales)
library(stringr)
# Reading the data
data <- read_csv("Where do people find meaning in life.csv")
# Select only the columns that have a name
data <- subset(data, select = c(1:5, 7:8))
head(data)
## # A tibble: 6 × 7
## Country flag `Family and Children` Friends Spouses and Romantic…¹ Career
## <chr> <chr> <dbl> <dbl> <dbl> <dbl>
## 1 United Stat… http… 49 20 9 17
## 2 Canada http… 42 19 6 26
## 3 Belgium http… 37 18 4 22
## 4 France http… 32 12 3 25
## 5 Germany http… 32 13 5 22
## 6 Greece http… 54 16 3 25
## # ℹ abbreviated name: ¹​`Spouses and Romantic Partners`
## # ℹ 1 more variable: Faith <dbl>
# changing the data to a long format
data_long <- pivot_longer(data, cols = -c(Country, flag), names_to = "variable", values_to = "value")
head(data_long)
## # A tibble: 6 × 4
## Country flag variable value
## <chr> <chr> <chr> <dbl>
## 1 United States https://plotset.com/charts/images/flags/us.svg Family and… 49
## 2 United States https://plotset.com/charts/images/flags/us.svg Friends 20
## 3 United States https://plotset.com/charts/images/flags/us.svg Spouses an… 9
## 4 United States https://plotset.com/charts/images/flags/us.svg Career 17
## 5 United States https://plotset.com/charts/images/flags/us.svg Faith 15
## 6 Canada https://plotset.com/charts/images/flags/ca.svg Family and… 42
#Making the plot
plot <- ggplot(data_long, aes(x = Country, y = value, fill = variable)) +
geom_bar(position = "fill", stat = "identity") +
scale_fill_manual(values = c("Family and Children" = "#332288", "Friends" = "#117733",
"Spouses and Romantic Partners" = "#88ccee",
"Career" = "#cc6677", "Faith" = "882255")) +
ggtitle("What Makes Life Meaningful?") +
xlab("Country") +
ylab("Percentage") +
theme_bw() +
scale_y_continuous(labels = percent_format(accuracy = 10), breaks = seq(0, 1, 0.1)) + # Making the percentages on y axis
theme(axis.text.x = element_text(angle = 45, hjust = 1))
Data Reference
Farivar, M. (2023). Where do people find meaning in life? plotset. Retrieved April 25, 2023, from https://plotset.com/gallery/4822bc93-97ce-4f11-8533-b4a1f7114e82?utm_source=reddit&utm_medium=cpc&utm_campaign=reddit_life_masoud&utm_id=reddit_life_masoud
Mitchell, T. (2022, March 22). What makes life meaningful? Views from 17 advanced economies. Pew Research Center’s Global Attitudes Project. Retrieved April 25, 2023, from https://www.pewresearch.org/global/2021/11/18/what-makes-life-meaningful-views-from-17-advanced-economies/
The following plot fixes the main issues in the original.