title: How to create a 100% stacked bar chart in R by counting data?
body: <p>I am trying to create a bar chart using ggplot that adds up difference scores and groups them with positive or negative values and then creates a graph of the percentage. I can't seem to figure out the right code to do this however and could use some guidance.</p>
  
  <p>I have two columns I am focusing on: one for the grade level and then another column with the difference score. I tried summing up the values of positive and negative for an aggregate total, but kept running into errors manipulating that data. </p>
  
  <p>I ended up making a new column and merged it to the data frame if the values in a row were less than or greater than 0. I was able to graph this, but I struggle to create a 100% stacked bar chart. </p>
  
  <p>Ideally what I hope to do is to create a stacked bar chart with grades 6th - 10th in the X-axis and the y-axis being the percentage of students in that grade with a positive difference score against the % with a negative score. </p>
  
  <pre><code># Attempting to create a new column of boolean values to create the chart
  Pos_Neg_df &lt;- c(Fall_Math_Data$RITDifference &gt;0)
  Percentage_Math_Data &lt;- cbind(Fall_Math_Data, Pos_Neg_df)
  
  # Plotted this
  
  ggplot(Percentage_Math_Data) +geom_bar(aes(x = Grade, fill = Pos_Neg_df)
  </code></pre>