title: plotting aggregate data with ggplot
body: <p>I have a data like this  </p>
  
  <pre><code>subject&lt;-1:208
  ev&lt;-runif(208, min=1, max=2)  
  seeds&lt;-gl(6,40,labels=c('seed1', 'seed2','seed3','seed4','seed5','seed6'),length=208)  
  ngambles&lt;-gl(2,1, labels=c('4','32'))    
  trial&lt;-rep(1:20, each= 2, length=208)  
  ngambles&lt;-rep('4','32' ,each=1, length=208)  
  data&lt;-data.frame(subject,ev,seeds,ngambles,trial)  
  </code></pre>
  
  <p>the data looks like this</p>
  
  <pre><code>subject       ev   seeds ngambles trial
        1 1.996717 seed1        4     1
        2 1.280977 seed1       32     1
        3 1.571648 seed1        4     2
        4 1.153311 seed1       32     2
        5 1.502559 seed1        4     3
        6 1.644001 seed1       32     3
  </code></pre>
  
  <p>I plot a graph with rep as x axis and expected_value as y axis for each seed and n_gambles by this command.  </p>
  
  <pre><code>qplot(trial,ev,data=data,
        facets=ngambles~seeds,xlab="Trial", ylab="Expected Value", geom="line")+
       opts(title = "Expected Value for Each Seed")
  </code></pre>
  
  <p>now I want to draw a new graph by aggregating ev for trial equal to 1-5, 6-10,11-15,and 16-20.    I also want to draw an error bar.</p>
  
  <p>I have no clue how to do in R
  maybe somebody can help me
  thanks in advance</p>