title: calculate mean of period in lubridate
body: <p>How to calculate mean of <code>period</code> in <code>lubridate</code> ?</p>
  <pre><code>library(lubridate)
  
  # tibble
  tbl &lt;- tibble(time_1 = ymd_hms(c(&quot;2021-01-01 12:00:00&quot;), (&quot;2021-01-01 12:12:36&quot;), (&quot;2021-01-01 14:25:45&quot;)),
                time_2 = ymd_hms(c(&quot;2021-01-01 12:12:36&quot;), (&quot;2021-01-01 14:25:45&quot;), (&quot;2021-01-01 15:35:45&quot;)),
                time_period = seconds_to_period(difftime(time_2, time_1, units = 'sec')))
  
  # calculate mean of period (WRONG ANSWER)
  tbl %&gt;% summarise(mean_val = mean(time_period))
  </code></pre>