title: Is there a function in R that will sum values based on Date of Year?
body: <p>I have a data table (Precip15) consisting of columns of precipitation, date of year (DOY), and Date_Time in POSIXct format. I need to be able to see the total precipitation (Rain_cm) for every day recorded. Any suggestions? </p>
  
  <p>An example of the data table format looks like this: </p>
  
  <pre><code>DOY     Rain     Rain_cm    Date_Time
  179      6         0.6      2019-06-28 15:00:00
  179      0         NA       2019-06-28 15:15:00
  179      2         0.2      2019-06-28 16:45:00
  180      0         NA       2019-06-29 10:00:00
  180      10.2      1.2      2019-06-29 10:15:00
  180      2         0.2      2019-06-29 13:00:00
  
  </code></pre>
  
  <p>I need it to look like this: </p>
  
  <pre><code>DOY     Rain_cm    
  179     0.8      
  180     1.4
  </code></pre>
  
  <p>or possibly: </p>
  
  <pre><code>Date           Rain_cm
  2019-06-28       0.8 
  2019-06-29       1.4
  </code></pre>
  
  <p>Thanks in advance for any help! </p>