title: How to plot a subset of a dataframe using ggplot2 in shiny
body: <p><a href="https://docs.google.com/spreadsheets/d/1mOBYkqqtoltX4kLC1zSyP3S34OK6NN-mCu_rUQydYjM/edit?usp=sharing" rel="nofollow noreferrer">https://docs.google.com/spreadsheets/d/1mOBYkqqtoltX4kLC1zSyP3S34OK6NN-mCu_rUQydYjM/edit?usp=sharing</a> - EuropeIndia data</p>
  <p>My data set has 45 different countries in a variable called location I am trying to subset the data to each country and plot a scatter plot for each country
  when I run the app the graph doesn't appear and I get 2 warnings</p>
  <p>warning 1: The select input &quot;location&quot; contains a large number of options; consider using server-side selectize for massively improved performance. See the Details section of the ?selectizeInput help topic.
  warning 2:&quot;Error in cat: argument 1 (type 'list') cannot be handled by 'cat'
  102: cat&quot;
  here is the code I used please let me know where I am going wrong, thanks in advance</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code># This is a Shiny web application. You can run the application by clicking
  # the 'Run App' button above.
  #
  # Find out more about building applications with Shiny here:
  #
  #    http://shiny.rstudio.com/
  #
  #
  # This is a Shiny web application. You can run the application by clicking
  # the 'Run App' button above.
  #
  # Find out more about building applications with Shiny here:
  #
  #    http://shiny.rstudio.com/
  #
  
  
  library(shiny)
  library(tidyverse)
  covid &lt;- read.csv("D:/R/Practice 3/EuropeIndia.csv")
  
  # Define UI for application 
  ui &lt;- fluidPage(
    
    # Application title
    titlePanel("Deaths vs all variables "),
    
    # Sidebar 
    sidebarLayout(
      sidebarPanel(
        selectInput("location", "Select a country",
                    choices = covid$location), selected = NULL),
      mainPanel(
        textOutput("location"),
        tabsetPanel(
          type = "tabs",
          tabPanel("cases",plotOutput("plot1t"), plotOutput("plot1n")),
          tabPanel("vaccinations",plotOutput("plot2t"), plotOutput("plot2n")),
          tabPanel("people",plotOutput("plot3t"),plotOutput("plot3n")),
          tabPanel("full vaccination",plotOutput("plot4t"), plotOutput("plot4n")),
          tabPanel("boosters",plotOutput("plot5t"), plotOutput("plot5n")),
          tabPanel("new vaccination",plotOutput("plot6t"),plotOutput("plot6n")),
          tabPanel("median age",plotOutput("plot7t"),plotOutput("plot7n")),
          tabPanel("new cases",plotOutput("plot8t"), plotOutput("plot8n")),
          tabPanel("summary", verbatimTextOutput("summary")),
          tabPanel("dataset", tableOutput("dataset"))
        )
      )
    )
  )
  
  server &lt;- function(input, output) {
    output$location &lt;- renderText({
      locationfilter &lt;- subset(covid, covid$location == input$location)
    })
    output$plot1t &lt;- renderPlot({
      ggplot(covid[covid$total_cases %in% "A", ],aes(y=total_deaths,x=total_cases))+geom_point()
      
    })
    output$plot1n &lt;- renderPlot({
      ggplot(covid[covid$total_cases %in% "A", ],aes(y=new_deaths,x=total_cases))+geom_point()
      
    })
    output$plot2t &lt;- renderPlot({
      ggplot(covid[covid$total_cases %in% "A", ],aes(y=total_deaths,x=total_vaccinations,color =location))+geom_point()
      
    })
    output$plot2n &lt;- renderPlot({
      ggplot(covid[covid$total_cases %in% "A", ],aes(y=new_deaths,x=total_vaccinations))+geom_point()
      
    })
    output$plot3t &lt;- renderPlot({
      ggplot(covid[covid$total_cases %in% "A", ],aes(y=total_deaths,x=people_vaccinated))+geom_point()
      
    })
    output$plot3n &lt;- renderPlot({
      ggplot(covid[covid$total_cases %in% "A", ],aes(y=new_deaths,x=people_vaccinated))+geom_point()
      
    })
    output$plot4t &lt;- renderPlot({
      ggplot(covid[covid$total_cases %in% "A", ],aes(y=total_deaths,x=people_fully_vaccinated))+geom_point()
      
    })
    output$plot4n &lt;- renderPlot({
      ggplot(covid[covid$total_cases %in% "A", ],aes(y=new_deaths,x=people_fully_vaccinated))+geom_point()
      
    })
    output$plot5t &lt;- renderPlot({
      ggplot(covid[covid$total_cases %in% "A", ],aes(y=total_deaths,x=total_boosters))+geom_point()
      
    })
    output$plot5n &lt;- renderPlot({
      ggplot(covid[covid$total_cases %in% "A", ],aes(y=new_deaths,x=total_boosters))+geom_point()
      
    })
    output$plot6t &lt;- renderPlot({
      ggplot(covid[covid$total_cases %in% "A", ],aes(y=total_deaths,x=new_vaccinations))+geom_point()
      
    })
    output$plot6n &lt;- renderPlot({
      ggplot(covid[covid$total_cases %in% "A", ],aes(y=new_deaths,x=new_vaccinations))+geom_point()
      
    })
    output$plot7t &lt;- renderPlot({
      ggplot(covid[covid$total_cases %in% "A", ],aes(y=total_deaths,x=median_age))+geom_point()
      
    })
    output$plot7n &lt;- renderPlot({
      ggplot(covid[covid$total_cases %in% "A", ],aes(y=new_deaths,x=median_age))+geom_point()
      
    })
    output$plot8t &lt;- renderPlot({
      ggplot(covid[covid$total_cases %in% "A", ],aes(y=total_deaths,x=new_cases))+geom_point()
      
    })
    output$plot8n &lt;- renderPlot({
      ggplot(covid[covid$total_cases %in% "A", ],aes(y=new_deaths,x=new_cases))+geom_point()
      
    })
    output$summary &lt;- renderPrint({
      summary(covid)
    })
    output$dataset &lt;- renderTable({
      covid
    })
  }
  
  # Run the application 
  shinyApp(ui = ui, server = server)</code></pre>
  </div>
  </div>
  </p>