title: ggplot: percentage counts line graph for factor groups on a scale
body: <p>Say I want to plot percentages of "yes" answers to a question, across different age groups in ggplot.  These age groups are obviously factors, but I want them to be shown in a scale-like fashion, so want to use a line graph.</p>
  
  <p>Here's some data:</p>
  
  <pre><code>mydata &lt;- data.frame(
      age_group = c("young", "middle", "old"),
      question = sample(c("yes", "no"), 99, replace = TRUE))
  mydata$age_group = factor(mydata$age_group,levels(mydata$age_group)[c(3, 1, 2)])  
  mydata$question = factor(mydata$question,levels(mydata$question)[c(2,1)]) 
  </code></pre>
  
  <p>So far, I have been using this code to generate a stacked barplot:   </p>
  
  <pre><code> ggplot(mydata, aes(age_group, fill = question)) +  geom_bar(position = "fill") 
  </code></pre>
  
  <p>How could I change this into a line graph, with just the frequency counts of the "yes" answers?  Mark in the answers suggests a workaround which produces the right output:
  <img src="https://i.stack.imgur.com/0xxd0.png" alt="enter image description here"></p>
  
  <p>But I hoping there was a way to do this automatically in one line of code, rather than creating this summary table first.</p>