Browse Source

Plot top 10 GHM

master
Maxime Wack 7 years ago
parent
commit
676a3c176d
1 changed files with 22 additions and 0 deletions
  1. +22
    -0
      app.R

+ 22
- 0
app.R View File

@@ -110,6 +110,28 @@ server <- function(input, output, session)
}
})

# GHM
data_ghm <- reactive({
GHM %>%
filter(Age <= input$slider_age[2] & Age >= input$slider_age[1],
date_entree <= input$slider_date[2] & date_sortie >= input$slider_date[1],
CP %in% in_bounds()$Codepos,
Sexe %in% input$check_sexe)
})

output$plot_ghm <- renderPlot({
data_ghm() %>%
count(GHM) %>%
top_n(10) %>%
arrange(n) %>%
mutate(GHM = GHM %>% factor(levels = GHM)) %>%
ggplot() +
aes(x = GHM, y = n) +
geom_bar(stat = "identity") +
coord_flip() +
theme(axis.title = element_blank())
})

# observe({
# output$plot_age <- renderPlotly({
# filteredData() %>%


Loading…
Cancel
Save