Skip to content

Instantly share code, notes, and snippets.

@allatambov
Last active April 29, 2021 10:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save allatambov/aaab267f9510e0e14c364275131555d0 to your computer and use it in GitHub Desktop.
Save allatambov/aaab267f9510e0e14c364275131555d0 to your computer and use it in GitHub Desktop.
install.packages("tidyverse")
library(tidyverse)
anames <- read.csv("https://allatambov.github.io/twimc/names.csv", encoding = "UTF-8")
names18 <- anames %>% filter(Year == 2018 & Month == "январь")
names18_f <- names18 %>% filter(Sex == "female")
names18_m <- names18 %>% filter(Sex == "male")
small_f <- names18_f %>% arrange(NumberOfPersons) %>% tail(10)
small_m <- names18_m %>% arrange(NumberOfPersons) %>% tail(10)
ggplot(data = small_f, aes(x = Name, y = NumberOfPersons, fill = Name)) +
geom_bar(stat = "identity")
ggplot(data = small_m, aes(x = Name, y = NumberOfPersons, fill = Name)) +
geom_bar(stat = "identity")
set.seed(1234)
sample(small_f$Name, size = 1)
sample(small_m$Name, size = 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment