Size is family
library(ggplot2)
library(gganimate)
happiness <- read.csv('happiness_project.csv', sep=",", header=TRUE)
ggplot(happiness, aes(happiness_score, economy_gdp_per_capita, size = family, color = country)) +
geom_point(alpha = 0.7, show.legend = FALSE) +
scale_size(range = c(2, 12)) +
scale_x_log10() +
facet_wrap(~region) +
labs(title = 'Year: {frame_time}', x = 'Happiness Score', y = 'Economy: GDP Per Capita') +
transition_time(year) +
ease_aes('linear')