title: I need to convert my hourly data to daily data by taking the sum
body: <p>data set :</p>
  
  <pre><code>structure(list(time = structure(c(1506406740, 1506406770, 1506406860, 
  1506406890, 1506406920, 1506406950, 1506406980, 1506407010, 1506407040, 
  1506407070), class = c("POSIXct", "POSIXt"), tzone = "UTC"), 
  Column3 = c(131, 131, 131, 131, 131, 131, 131, 131, 131, 
  131), m_Pm = c(2.402842, 2.556558, 2.805165, 2.97428, 3.101824, 
  3.23984, 3.359587, 3.474448, 3.62753, 3.773597)), row.names = c(NA, 
  -10L), class = c("tbl_df", "tbl", "data.frame")) 
  </code></pre>
  
  <p>It works alright till the first aggregate function . after that I am not able to get the correct answer after the sum function . I'm getting large values instead </p>
  
  <pre><code>library(dplyr)
  library(ggplot2)
  
  attach(data)
  data %&gt;% #filtering 131 and 132
    select(time,Column3,m_Pm) %&gt;%
    filter(data,Column3=="131") 
  filter(data,Column3=="132")
  data_131&lt;-filter(data,Column3=="131") 
  data_132&lt;-filter(data,Column3=="132") 
  
  #datehour column (dailyaverage)
  data_131$datehour&lt;-format(data_131$time,"%Y-%m-%d %H")
  aggregate(m_Pm~datehour,data_131, mean)
  
  #datecolumn
  
  data_131$date1&lt;-format(data_131$time,"%Y-%m-%d")
  dE_131&lt;-aggregate(m_Pm~date1,data_131,sum)
  dE_131}
  </code></pre>
  
  <p>Since the data is too huge, I cannot post it here. 
  It is a 7 months data of every 30 seconds.</p>