My Shiny UI and Server code looks like:
shinyUI(navbarPage("Data Dashboard",
                   tabPanel("Education"),
                   navbarMenu("Healthcare",
                              tabPanel("Insurance",
                                       sidebarPanel(
                                         selectInput("variable", "Factor: ",
                                                     list("Uninsured %" = "uninsured", 
                                                          "Primary Care Physicians" = "primary_care_physicians", 
                                                          "Mental Health Providers" = "mental_health_providers",
                                                          "Dentists" = "dentists"
                                                     ))
                                       ),
                                       mainPanel(
                                         plotOutput("yearPlot"))),
                              tabPanel("Metrics",
                                       sidebarPanel(
                                         selectInput("variable", "Metric: ",
                                                     list("Adult Obesity" = "adult_obesity", 
                                                          "Adult Smoking" = "adult_smoking", 
                                                          "Accident Deaths" = "motor_vehicle_crash_deaths",
                                                          "Physical Inactivity" = "physical_inactivity",
                                                          "Alcoholism" = "excessive_drinking",
                                                          "Diabetes" = "diabetes"
                                                     ))
                                       ),
                                       mainPanel(
                                         plotOutput("metPlot")))),
                   navbarMenu("More",
                              tabPanel("Sub-Component A"),
                              tabPanel("Sub-Component B"))
                   ))
shinyServer(function(input, output) {
  #Healthcare: Insurance
  output$yearPlot <- renderPlot({
    df <- data.frame(year=as.factor(insurance$year), County = as.factor(insurance$County), variable = insurance[[input$variable]])
    ggplot(df, aes_string(df$year, y=df$variable, fill = df$County)) + geom_bar(stat = "Identity") + facet_wrap(~df$County)
  })
  #Healthcare: Metrics
  output$metPlot <- renderPlot({
    df2 <- data.frame(year=as.factor(healthdata$year), County = as.factor(healthdata$County), variable = healthdata[[input$variable]])
    ggplot(df2, aes_string(df2$year, y=df2$variable, fill = df2$County)) + geom_bar(stat = "Identity") + facet_wrap(~df2$County)
  })
})
I keep getting the error: Error in data.frame: arguments imply differing number of rows: 15, 0. I was wondering if I should add a separate input parameter to the shinyServer function but I'm a little confused as to why this is happening.
My data:

