Преглед на файлове

Plot GHM par sexe

master
Maxime Wack преди 7 години
родител
ревизия
c52a969cf5
променени са 1 файла, в които са добавени 8 реда и са изтрити 6 реда
  1. +8
    -6
      app.R

+ 8
- 6
app.R Целия файл

@@ -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…
Отказ
Запис