finding start and end time of each session id in r suppose i have a dataframe

suppose i have a dataframe

 &gt; data
session id     timestamp                 item id 
  1         2014-04-0618:42:05.822         1 
  1         2014-04-0618:42:06.800         1
  1         2014-04-0618:42:06.820         1
  2         2014-04-0315:27:48.118         1
  2         2014-04-0315:27:49.440         2
  3         2014-04-0315:27:49.550         1
  3         2014-04-0315:27:50.240         0
  3         2014-04-0315:27:50.540         3
  3         2014-04-0315:27:51.530         2


and i want to find out each session start and end time and unique items in each session mean i want output like this

&gt;  result   
session id   session start and end time                         distinctitems in each session  
 1           2014-04-0618:42:05.822, 2014-04-0618:42:06.820           1 
 2           2014-04-0315:27:48.118, 2014-04-0315:27:49.440           2
 3           2014-04-0315:27:49.550, 2014-04-0315:27:51.530           4


how can i do this?
Assuming you have access to dplyr package, you can do the following. 


data %&gt;% group_by(session_id) %&gt;% summarise(start_time = min(timestamp), end_time = max(timestamp), unique_items=length(unique(item_id)))