0

I want to have count by variable levels and also whole count, for example count for female, male and the whole count. With these scripts I can have statistics for only female or male not the whole statistic

library(shiny)
library(dplyr)

# user interface
ui <- fluidPage(
  titlePanel("Patients pris en charge pour une chirurgie bariatrique au CHIC"),
  sidebarLayout(
    sidebarPanel(
      radioButtons(inputId = "Gender",
                   label= "Chose the gender",
                   choices = list("Female","Male" ))
    ),
    mainPanel(leafletOutput("mymap"))
  )
)

# serveur
server <- function(input, output, session) {


  filteredData <- reactive({
    dataset%>%
      filter( Gender==input$Gender) 

  })

I want something like this where I can display the Total too.

enter image description here

bretauv
  • 7,756
  • 2
  • 20
  • 57
Seydou GORO
  • 1,147
  • 7
  • 13
  • 3
    Can you add a `dput()`? Please, see https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – cmirian May 16 '20 at 17:56
  • I dont't know how to add a dput() of a shiny application. – Seydou GORO May 16 '20 at 19:39
  • 1
    the use of `dput()` does not change if you have a shiny app or something else. Just apply the function on a subset of your data and put the output in your post. See the link provided by @cmirian for more details – bretauv May 16 '20 at 20:49

0 Answers0