I am new to Shiny and I've been struggling with the following. In the ui I define a set of variables that users can choose. However, when I call upon the input variable the correct label for the variable displays on the x-axis but there is no data. When I change the input$variable to any of the actual variable names, the correct results display. What am I doing wrong?
output$analysis1 <- renderPlot({
df <- m1
df <- subset(df, df$rcid %in% unique(Select_voting()$rcid))
ggplot(subset(df, unsc_region == 'Latin America'), aes(x = input$variable, y = reorder(CountryAbb, input$variable),
color = ordvote)) +
geom_point(size=3) + theme_light() + ggtitle("Latin America") + scale_colour_manual(values=vcolors)
})