title: Legend in ggplot when aes() color and shape are not specified
body: <p>I am a relative newcomer to ggplot, and have made the figure below with the data and code included here…</p>
  
  <p>The data is here</p>
  
  <pre><code>Data &lt;- structure(list(IndID = structure(1:17, .Label = c("AA", "BB", 
  "CC", "DD", "EE", "FF", "GG", "HH", "II", "JJ", "KK", "LL", "MM", 
  "NN", "OO", "PP", "QQ"), class = "factor"), Avg = c(7.95, 10.483, 
  5.951, 7.359, 10.465, 10.745, 14.402, 81.417, 67.087, 4.254, 
  34.393, 47.324, 60.713, 75.446, 64.527, 28.779, 54.764), AvgSE = c(1.685, 
  2.949, 1.097, 2.607, 4.256, 3.539, 1.702, 3.314, 0.714, 0.302, 
  1.154, 1.827, 0.573, 1.292, 1.955, 1.341, 1.949), OBS = c(7.667, 
  10, 8, 7.5, 14, 10.333, 12, 91, 53, 7, 29, 36.5, 43, 61, 61, 
  24, 38)), .Names = c("IndID", "Avg", "AvgSE", "OBS"), class = "data.frame", row.names = c(NA, 
  -17L))
  </code></pre>
  
  <p>And looks like this</p>
  
  <pre><code>&gt; head(Data)
    IndID    Avg AvgSE    OBS
  1    AA  7.950 1.685  7.667
  2    BB 10.483 2.949 10.000
  3    CC  5.951 1.097  8.000
  4    DD  7.359 2.607  7.500
  5    EE 10.465 4.256 14.000
  6    FF 10.745 3.539 10.333
  </code></pre>
  
  <p>My code for the plot is here</p>
  
  <pre><code>ggplot(Data, aes(x=IndID, y=Avg))+
      geom_point()+
      geom_errorbar(aes(ymin=Avg-AvgSE, ymax=Avg+AvgSE))+
      geom_point(aes(y=OBS),color="red", pch = 8) +
      theme(axis.text.x=element_text(angle=30, hjust=1))
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/tY6Zo.jpg" alt="enter image description here"></p>
  
  <p>I have plotted two different sets of points.  I do not have a factor to specify in the <code>aes()</code> argument as a <code>color</code> or <code>shape</code>.  Most SO posts I have seen use these arguments after which a legend appears by default.  As far as I can tell (after seeing many posts and using the R Graphics Cookbook), building a legend like in the base R functions is less straight forward.  </p>
  
  <p>Is the best option to change the data structure as suggested here http://<a href="https://stackoverflow.com/questions/17713919/r-ggplot-2-geom-points-how-to-add-a-legend">stackoverflow.com/questions/17713919/r-ggplot-2-geom-points-how-to-add-a-legend</a> using melt()?</p>
  
  <p>Or is there another way to create a legend?</p>
  
  <p>In my figure aboveI simply want a legend for each set of points.  One for the black (Avg) pts and another for the OBS points.  </p>
  
  <p>Any suggestions would be appreciated!</p>