[R] Splitting a time + duration into a series of periods

Travers Naran tnaran at gmail.com
Fri Sep 24 21:32:37 CEST 2010


Hi all,

Here's what I have. I have a list of log-in times for users and how
long their sessions were.

user, login_time, session_min
alice, 2010/01/01 10:00, 145
bob, 2010/01/01 11:00, 30

What I want to do is create a bar chart showing, in 1/2 hour segments,
the number of users logged in at the same time.  For example:

10:00 1
10:30 1
11:00 2
11:30 1

The only way I can do this now is to send the data through a Perl
script to generate raw data like:

alice, 2010/01/01, 10:00
alice, 2010/01/01, 10:30
alice, 2010/01/01, 11:00
...
bob, 2010/01/01, 11:00

I've looked through the man pages for a couple hours now, and I can't
find a better of way of doing this directly in R.  Any help or
pointers?  Thanks in advance.



More information about the R-help mailing list