Data from #tidytuesday week of 2020-05-05 (source)
Load packages
library(tidyverse)
library(ggfortify)
Download data
villagers_raw <- read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-05-05/villagers.csv')
Process data
villagers <- villagers_raw %>%
select(gender, species, personality) %>%
mutate(species = str_to_title(species)) %>%
group_by(gender, species, personality) %>%
summarize(n = n()) %>%
mutate(pct_total = n / sum(n)) %>%
ungroup()
Visualize data
villagers %>%
ggplot(aes(personality, pct_total, fill = gender, color = gender, group = gender)) +
geom_polygon(alpha = 0.5) +
geom_point() +
coord_polar() +
facet_wrap(~species) +
labs(x = NULL, y = NULL, color = NULL, fill = NULL,
title = "Animal Crossing: villager personality traits by species & gender",
caption = "by: @eeysirhc\nsource:VillagerDB") +
theme_bw() +
theme(legend.position = 'top',
axis.text.y = element_blank(),
axis.ticks.y = element_blank())
Moment of zen
#tidytuesday about #AnimalCrossing villager personality traits for species x gender
— Christopher Yee (@Eeysirhc) May 6, 2020
Crankiest neighbor? male kangaroo
Most normal? female octopus#rstats code: https://t.co/j9bU36DG3r #tardytuesday pic.twitter.com/uNTZtVhuz3