[R] converting a data frame to ts objects

fatih ozgul fatih.ozgul at gmail.com
Wed May 16 12:47:06 CEST 2007


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



More information about the R-help mailing list