title: ggplot2 geom_bar: plot sum of two variables and group by proportion of each variable
body: <p>I could not find an answer / a solution to the following question:</p>
  
  <p>I have two numeric variables. I take the sum of both and want to bar plot the relative frequency of that summed variable + indicate the proportion of its sub components (i.e. the mean proportion of one variable as part of the sum).</p>
  
  <p>Example: I have v1 = number questions and v2 = number of answers. Each observation can have x questions and y answers and x+y interactions.</p>
  
  <p>Example code:</p>
  
  <pre><code>df &lt;- data.frame(matrix(ncol = 2, nrow = 5))
  x &lt;- c("questions", "answers")
  colnames(df) &lt;- x
  
  df$questions &lt;- c(1,2,3,1,2)
  df$answers &lt;- c(2,3,4,2,3)
  df$interactionsum &lt;- df$questions + df$answers
  
  
  ggplot(df, aes(x = interactionsum)) +
    geom_bar(aes(y = (..count..)/sum(..count..))) + 
    ylab("Relative frequencies") +
    xlab("Sum of interactions")
  </code></pre>
  
  <p>In this data setting, one third of the first bar would be questions (mean proportion) and two thirds answers (mean proportion). How can I achieve this type of grouping with ggplot2?</p>
  
  <p>Thank you in advance!</p>