title: R- Calculate mean of Time variable mean(DateTime)
body: <p>This is an example of my dataset:</p>
  
  <pre><code>&gt; head(daily[,c(6,7)])-&gt;test
  &gt; head(test)
                  timeMin  min
  316 2013-05-02 13:45:00 3239
  317 2013-05-03 12:30:00 3260
  318 2013-05-04 12:30:00 3165
  319 2013-05-05 12:30:00 3404
  320 2013-05-06 12:30:00 3514
  321 2013-05-07 13:15:00 3626
  </code></pre>
  
  <p>I need mean(timeMin), in order to know what´s the time of the day (hour:minute) at what the event usually happens. I have tried this:</p>
  
  <pre><code>library(lubridate)
  &gt; test$hourMin&lt;-paste(hour(test$timeMin),minute(test$timeMin),sep=":”)
  &gt; test$hourMin &lt;- hm(test$hourMin)  
  </code></pre>
  
  <p>And I got this:</p>
  
  <pre><code>&gt; head(test)
                  timeMin  min    hourMin
  316 2013-05-02 13:45:00 3239 13H 45M 0S
  317 2013-05-03 12:30:00 3260 12H 30M 0S
  318 2013-05-04 12:30:00 3165 12H 30M 0S
  319 2013-05-05 12:30:00 3404 12H 30M 0S
  320 2013-05-06 12:30:00 3514 12H 30M 0S
  321 2013-05-07 13:15:00 3626 13H 15M 0S
  </code></pre>
  
  <p>however, when I try to calculate the mean I had no result:</p>
  
  <pre><code>&gt; mean(test$hourMin)
  [1] 0
  </code></pre>
  
  <p>It should be straightforward, but I don´t know how to do it, since I am a beginner. I would appreciate any help. Thanks </p>