title: Bar Chart + Line Graph on One Plot with GGPlot
body: <p>I am attempting to make a grouped bar chart...with a few modifications.</p>
  
  <p>I have four "columns" for my chart: Quarter, Person, Percentage, Total Percentage. An example of my data looks like this:</p>
  
  <p>| Person    | Quarter   | Percentage    | Total Percentage  |</p>
  
  <p>|--------   |---------  |------------   |------------------ |</p>
  
  <p>| A         | 1         | 40%           | 50%               |</p>
  
  <p>| A         | 2         | 45%           | 50%               |</p>
  
  <p>| A         | 3         | 55%           | 50%               |</p>
  
  <p>| A         | 4         | 60%           | 50%               |</p>
  
  <p>| B         | 1         | 35%           | 42%               |</p>
  
  <p>and so forth for. </p>
  
  <p>I have successfully made my bar chart using this code:</p>
  
  <pre><code>ggplot(data=point3, aes(x=Person, y=Percentage, fill=Quarter)) + 
  +     geom_bar(colour="black", stat="identity", position=position_dodge(), size=.3)                       
  +     scale_fill_hue(name="Quarter") 
  +     xlab(" ") + ylab("Percentage") 
  +     theme_bw()
  </code></pre>
  
  <p>However, I would like to change a few things. First, I would like to space out the x-axis. There are four bars per person and I was wondering how I could make it so that there is more space in between each person. I've run into trouble with this because the X axis doesn't contain any numbers of any sort. Does anyone know how to do this?</p>
  
  <p>Second, I would like to add a vertical line for each person representing their total percentage. This way, it would be easy for the viewer to see which quarter the person performed under their yearly average and which quarter they over-performed. I have had a little success with this using</p>
  
  <pre><code>geom_point(data=point3, aes(x=Person, y=Total Percentage))
  </code></pre>
  
  <p>at the end of the previous code, but this simply adds a dot between the second and third bars (the middle). I made a <a href="http://i.imgur.com/OPamqH5.png" rel="nofollow">mock up of this using a grouped bar chart</a> I found via Google. This one only has 3 bars, but perhaps you can get the idea. Some of the problems I ran into this time were, although they are on the same scale, the y-axis for the bar charts is "Performance" while the y-axis for the line is "Total Performance". R did not seem to like this. Also, the whole x-axis not being numeric.</p>
  
  <p>I used ggplot2 because I didn't know what else to use, but if you know of any technique/package to make this work, I am happy to change that. I am also aware I may need to reshape my data, that is cool, too. </p>
  
  <p>Thanks so much.</p>