title: Time frame extraction in R
body: <h2>I have a dataset which looks like the following:</h2>
  
  <pre><code>    date    time_interval
      1050901 00:01~01:00
      1050901 01:01~02:00
      1050901 02:01~03:00
      .. ..
      1051231 23:01~24:00
  </code></pre>
  
  <h2>I want to create the new variable indicating the starting time and the ending time, for example</h2>
  
  <pre><code>    date    time_interval  starting_time     ending_time
      1050901 00:01~01:00    2016 Sep 1 00:01  2016 Sep 1 01:00
      1050901 01:01~02:00    2016 Sep 1 01:01  2016 Sep 1 02:00
      1050901 02:01~03:00    2016 Sep 1 02:01  2016 Sep 1 03:00
      ....
      1051231 23:01~24:00    2016 Dec 31 23:01 2016 Dec 31 24:00
  </code></pre>
  
  <p>How should I extract the first and the second values in the second column and aggregate it with the first column? Thanks a lot!</p>