[R] converting a data frame to ts objects

From: fatih ozgul <fatih.ozgul_at_gmail.com>
Date: Wed, 16 May 2007 13:47:06 +0300

Dear R-ians

I have a data frame like

Person_id  Date/time        Count
---------  ----------      -------
123         20 May 1999      1
123         21 May 1999      3
222         1  Feb 2000      2
222         3  Feb 2000      4

I want to create ts objects for each person_id (i.e. 123 and 222). Time series frequency can be in months and all starting from the same date (i.e. May 1999).

Rather than manually creating sum of counts for each month and creating ts objects manually for each persons,

Is there a function for creating ts objects automatically from such data?

Thanks,

Faith OZGUL



R-help_at_stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 16 May 2007 - 10:51:11 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 16 May 2007 - 13:31:07 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.