R/Shiny/ggplot2: checkboxGroup to plot specific data
<p>Building from my last <a href="https://stackoverflow.com/questions/37327826/shiny-r-too-many-factors-on-line-graph/37331259#37331259">post</a> I want to use selectInput to allow users to plot as many regions as they wanna plot.</p>

<p>My data looks like this:</p>

<pre><code>Year    Ratio   Region
1983 Q1 2.9 Northern
1983 Q2 3   Northern
1983 Q3 3.1 Northern
1983 Q4 3   Northern
...
2015 Q2 5.1 UK
2015 Q3 5.1 UK
2015 Q4 5.2 UK
2016 Q1 5.2 UK
</code></pre>

<p>server.R snippet</p>

<pre><code>houseratio &lt;- read.csv("houseratio.csv", stringsAsFactors = FALSE)  

output$housePlot &lt;- renderPlot({
ggplot(data=houseratio[,input$region_choose], aes(x=Year, y=Ratio, group=Region, colour=Region)) +
  geom_line() +
  geom_point()
})
</code></pre>

<p>ui.r snippet</p>

<pre><code>checkboxGroupInput("region_choose", label = "Choose a region",
          choices = c("The North"="Northern", "Yorkshire &amp; Humber" = "Yorks &amp; H",
                      "North West"="NW","East Midlands"="East Mids", 
                      "West Midlands"="West Mids", "East Anglia"="East Anglia",
                      "Outer South East"="Outer SE", "Outer Met"="Outer Met", 
                      "London"="London", "South West"="SW", "Wales"="Wales",
                      "Northern Ireland"="NI", "UK"="UK")
          ),

  plotOutput("housePlot")
)
</code></pre>

<p><a href="https://stackoverflow.com/questions/37163996/selectinput-and-plot-render">This post</a> and <a href="https://stackoverflow.com/questions/32462905/selectinput-as-argument-for-ggplot2">this post</a> kinda helped but as my data is in long format it didn't seem to work (also because they're selectInput but weh).</p>

<p>Any help would be appreciated, if I've missed anything crucial- sorry, what is it?</p>