title: R - Aggregate.Data.Frame With Quartiles
body: <p>I am new (very new) to R coding and can't seem to figure out how to get the quartiles output correct. Might be much simpler than I am finding it to be!</p>
  
  <p>PLEASE HELP!</p>
  
  <p>This is the code I currently have and it is working perfectly for median and mean.</p>
  
  <pre><code>MedianCol = aggregate.data.frame(
    x = list(COLVALUE=COLVALUE),
    by = list(YEAR=YEAR),
    FUN = median,
    na.rm=TRUE
  )
  
  MeanCol = aggregate.data.frame(
    x = list(COLVALUE=COLVALUE),
    by = list(YEAR=YEAR),
    FUN = mean,
    na.rm=TRUE
  )
  
  #This is where I have an issue, I don't know how to even code it
  Q3Col = aggregate.data.frame(
    x = list(COLVALUE=COLVALUE),
    by = list(YEAR=YEAR),
    FUN = quantile(0.25),
    na.rm=TRUE
  )
  
  #I will have to add the quartiles in the merge below as well
  MovingAverage &lt;- merge(x = MedianCol, y = MeanCol, by = "YEAR", all = TRUE)
  </code></pre>
  
  <p>The Q3Col is where I need the Third Quartile value to be returned. I also need the first Quartile, Best Decile and Worst Decile.  </p>
  
  <p>My Data looks like this:
  <a href="https://i.stack.imgur.com/BPjHW.png" rel="nofollow noreferrer">Data</a></p>
  
  <p>Thank you in advance!</p>