title: Aggregate as new column in R
body: <p>Input:</p>
  
  <pre><code>Time,id1,id2
  22:30,1,0
  22:32,2,1
  22:33,1,0
  22:34,2,1
  </code></pre>
  
  <p>Output Desired</p>
  
  <pre><code>Time,Time2,id1,id2
  22:30,22:33,1,0
  22:32,22:34,2,1
  </code></pre>
  
  <p>Output by my code</p>
  
  <pre><code>Time,id1,id2
  22:30,22:33,1,0
  22:32,22:34,2,1
  </code></pre>
  
  <p>What change should I make to my code <code>aggregate(Time~,df,FUN=toString)</code>
  My id1 and id2 together is the key and times are in and out time for each key. I need to get time in and time out as separate column values. Currently they are in column Time.</p>
  
  <p>I tried it using awk also. </p>