Created
April 7, 2017 16:37
-
-
Save gshotwell/325632c1ba67e10e7951ecc220bc3da4 to your computer and use it in GitHub Desktop.
Women in Technology StackOverflow Sruvey
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(stacksurveyr) | |
library(dplyr) | |
library(tidyr) | |
library(purrr) | |
library(stringr) | |
library(ggplot2) | |
library(forcats) | |
df <- stack_survey %>% | |
select(respondent_id, gender, tech_do) %>% | |
filter(!is.na(gender) & !is.na(tech_do)) | |
tech <- str_split(df$tech_do, ";") | |
reshape_data <- function(str, gender){ | |
data_frame(gender = gender, tech = str) | |
} | |
df <- map2_df(tech, df$gender, ~reshape_data(.x, .y)) | |
gender_dist <- df %>% | |
group_by(tech, gender) %>% | |
tally() %>% | |
mutate(percent_total = n / sum(n)) | |
popular_female <- gender_dist %>% | |
filter(gender == 'Female') %>% | |
filter(n > 10) %>% | |
arrange(desc(percent_total)) | |
popular_female %>% | |
filter(tech %in% popular_female$tech) %>% | |
.[1:20, ] %>% | |
ggplot( aes(x = percent_total, | |
y = fct_reorder(tech, as.numeric(percent_total))))+ | |
geom_point() + | |
xlab("Percentage of Stackoverflow Survey Responses") + | |
ylab("Total")+ | |
ggtitle("Technologies with more than 10 women responses") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment