R group by date, and summarize the values
<p>R is new for me and I am working with a (private) data set.</p>

<p>I have the following problem, I have a lot of time series: </p>

<pre><code>2015-04-27  12:29:48
2015-04-27  12:31:48
2015-04-27  12:34:50
2015-04-27  12:50:43
2015-04-27  12:53:55
2015-04-28  00:00:00
2015-04-28  00:00:10
</code></pre>

<p>All the timeseries have a value: </p>

<pre><code>Datetime                   value
2015-04-27  12:29:48       0.0 
2015-04-27  12:31:48       0.0
2015-04-27  12:34:50       1.1
2015-04-27  12:50:43      45.0 
2015-04-27  12:53:55       0.0
2015-04-28  00:00:00       1.0
2015-04-28  00:00:10       2.0
</code></pre>

<p>I want to skip all the hours and minutes, and sum it all together like this:</p>

<pre><code>Datetime      value
2015-04-27    46.1
2015-04-28     3.0
</code></pre>

<p>The first thing i did was transform the column datetime:</p>

<pre><code>energy$datetime &lt;- as.POSIXlt(energy$datetime)  
</code></pre>

<p>I tried the summarize function: </p>

<pre><code>df %&gt;% group_by(energy$datetime) %&gt;% summarize (energy$newname(energy$value))
</code></pre>

<p>But that isn't working. </p>

<p>I also read competitive stuff on the internet (e.g.: <a href="http://r.789695.n4.nabble.com/How-to-sum-and-group-data-by-DATE-in-data-frame-td903708.html" rel="noreferrer">http://r.789695.n4.nabble.com/How-to-sum-and-group-data-by-DATE-in-data-frame-td903708.html</a>) but it doesn't make sense to me.</p>

<p>How can I fix this issue?</p>