title: R shiny Filter issues
body: <p>Having trouble with executing functioning filters in my R shiny project (not sure if it is an issue with the UI or the server) --> neighbourhood and number of reviews will not communicate with room type and region filters. </p>
  
  <p><strong>Server Code</strong></p>
  
  <pre><code>options(shiny.maxRequestSize=30*1024^2)
  library(shiny)
  library(leaflet)
  library(dplyr)
  
  # Define server that analyzes the Singapore Airbnb Listings
  shinyServer(function(input, output) {
  
    # Create an output variable for problem description
    output$text &lt;- renderText({
  
      "This project uses the dataset .................FILL OUT LATER........."
  
    })
  
  
    # Create a descriptive table for NBHD
    output$table1 &lt;- renderPrint({
  
      # Connect to the sidebar of file input
      inFile &lt;- input$file
  
      if(is.null(inFile))
        return("Please Upload A File For Analysis")
  
      # Read input file
      mydata &lt;- read.csv(inFile$datapath)
      attach(mydata)
  
      # Filter the data for different Room Types and Regions
      target1 &lt;- c(input$room_type)
      neighbourhood_df &lt;- filter(mydata, room_type %in% target1)
  
      # Create a table for NBHD
      table(mydata$neighbourhood)
  
    })
  
    # Create a descriptive table for # of reviews
    output$table2 &lt;- renderPrint({
  
      # Connect to the sidebar of file input
      inFile1 &lt;- input$file
  
      if(is.null(inFile1))
        return("Please Upload A File For Analysis")
  
      # Read input file
      mydata1 &lt;- read.csv(inFile1$datapath)
      attach(mydata1)
  
      # Filter the data for different Room Type and Region
      target3 &lt;- c(input$room_type)
      target4 &lt;- c(input$region)
      number_of_reviews_df &lt;- filter(mydata1, room_type %in% target3 &amp; region %in% target4)
  
      # Create a table for Rooms
      table(mydata1$number_of_reviews)
  
    })
  
  
    # Create a map output variable
    output$map &lt;- renderLeaflet({
  
      # Connect to the sidebar of file input
      inFile2 &lt;- input$file
  
      if(is.null(inFile2))
        return(NULL)
  
      # Read input file
      mydata2 &lt;- read.csv(inFile2$datapath)
      attach(mydata2)
  
      # Filter the data for different Room Type and Region
      target5 &lt;- c(input$room_type)
      target6 &lt;- c(input$region)
      map_df &lt;- filter(mydata2, room_type %in% target5 &amp; region %in% target6)
  
      # Create colors with a categorical color function
      color &lt;- colorFactor(rainbow(9), mydata2$neighbourhood)
  
      # Create the leaflet function for data
      leaflet(map_df) %&gt;%
  
        # Set the default view
        setView(lng = 103.8608, lat = 1.2834, zoom = 12) %&gt;%
  
        # Provide tiles
        addProviderTiles("CartoDB.Positron", options = providerTileOptions(noWrap = TRUE)) %&gt;%
  
        # Add circles
        addCircleMarkers(
          radius = 2,
          lng= mydata2$longitude,
          lat= mydata2$latitude,
          stroke= FALSE,
          fillOpacity=0.1,
          color=color(neighbourhood)
        ) %&gt;%
  
        # Add legends for different nbhds
        addLegend(
          "bottomleft",
          pal=color,
          values=neighbourhood,
          opacity=0.5,
          title="Singapore Neighbourhood"
        )
    })
  })
  </code></pre>
  
  <p><strong>UI Code</strong></p>
  
  <pre><code>    library(shiny)
  library(leaflet)
  library(shinythemes)
  
  # Define UI for application that analyzes the patterns of crimes in DC
  shinyUI(fluidPage(
  
    # Change the theme to flatly
    theme = shinytheme("flatly"),
  
    # Application title
    titlePanel("Patterns of Crimes in Washington DC"),
  
    # Three sidebars for uploading files, selecting Room types and Regions
    sidebarLayout(
      sidebarPanel(
  
        # Create a file input
        fileInput("file","Choose A CSV File Please",
                  multiple = TRUE,
                  accept = c("text/csv",
                             "text/comma-separated-values,text/plain",
                             ".csv")),
  
        # Create a multiple checkbox input for Room Type
        checkboxGroupInput("RoomType",
                           "Room Type:",
                           c("Private Room","Entire home/apt","Shared room")
        ),
  
        hr(),
        helpText("Please Select The Room type for listing analysis"),
        helpText("You Can Choose More Than One"),
  
        hr(),
        hr(),
  
        # Create a multiple checkbox input for Regions
        checkboxGroupInput("Region",
                           "Region:",
                           choices = list("Central Region"= 1,"East Region"= 2,"North Region"= 3,"North-East Region"= 4,
                                          "West Region"= 5)
        ),
  
        hr(),
        helpText("Please Select The Regions You Would Like To Analyze For Listing Patterns"),
        helpText("You Can Choose More Than One")
      ),
  
      # Make the sidebar on the right of the webpage
      position = "right",
      fluid = TRUE,
  
  
  
      # Create two tabs
      mainPanel(
        hr(),
        tabsetPanel(type="tabs",
  
                    #Add a tab for Analysis Overview
                    tabPanel("Analysis Overview", textOutput("text")),
  
                    #Add a tab for Room type and Region
                    tabPanel("Listing Analysis",
  
                             #Add two subtabs
                             tabsetPanel(
                               tabPanel("Neighbourhood",verbatimTextOutput("table1")),
                               tabPanel("Number of Reviews",verbatimTextOutput("table2"))
                             )
                    ),
  
  
                    #Tab for the Leaflet Map
                    tabPanel("Map", leafletOutput("map", height=630))
        )
      )
    )
  ))
  </code></pre>