title: Aesthetics must either be length one or the same length
body: <p>I am trying to plot values and errorbars, a seemingly simple task. As the script is fairly long, I am trying to limit the code in give here to the necessary amount.</p>
  
  <p>I can plot the graph without error bars. However, when trying to add the errorbars I get the message </p>
  
  <p><code>Error: Aesthetics must either be length one, or the same length as the dataProblems:Tempdata</code></p>
  
  <p>This is the code I am using. All vectors in the Tempdata data frame are of length 390. </p>
  
  <pre><code>Tempdata &lt;- data.frame (TempDiff, Measurement.points, Room.ext.resc, MelatoninData, Proximal.vs.Distal.SD.ext, ymax, ymin)
  p &lt;- ggplot(data=Tempdata, 
          aes(x = Measurement.points, 
              y = Tempdata, colour = "Temperature Differences")) 
  p + geom_line(aes(x=Measurement.points, y = Tempdata$TempDiff, colour = "Gradient Proximal vs. Distal"))+
  geom_errorbar(aes(ymax=Tempdata$ymax, ymin=Tempdata$ymin))
  </code></pre>