Browse Source

Plot GHM par sexe

master
Maxime Wack 7 years ago
parent
commit
c52a969cf5
1 changed files with 8 additions and 6 deletions
  1. +8
    -6
      app.R

+ 8
- 6
app.R View File

@@ -122,15 +122,17 @@ server <- function(input, output, session)

output$plot_ghm <- renderPlot({
data_ghm() %>%
count(GHM) %>%
top_n(10) %>%
arrange(n) %>%
mutate(GHM = GHM %>% factor(levels = GHM)) %>%
count(GHM, Sexe) %>%
semi_join(GHM %>% count(GHM) %>% top_n(10) %>% arrange(n), by = "GHM") %>%
ungroup %>%
mutate(GHM = GHM %>% factor(levels = GHM %>% unique)) %>%
ggplot() +
aes(x = GHM, y = n) +
aes(x = GHM, y = n, fill = Sexe) +
geom_bar(stat = "identity") +
scale_fill_manual(values = c("Homme" = "lightblue", "Femme" = "pink")) +
coord_flip() +
theme(axis.title = element_blank())
theme(axis.title = element_blank(),
legend.position = "none")
})

# Sexe


Loading…
Cancel
Save