[R] Adding a time variable prior to using reshape

peter dalgaard pdalgd at gmail.com
Wed Oct 6 16:22:14 CEST 2010


On Oct 6, 2010, at 16:11 , Henrique Dallazuanna wrote:

> Try this:
> 
> with(foo, ave(Value, Label, FUN = seq)) will generate the time variable

Make that FUN=seq_along to avoid trouble with groups of size 1.


-- 
Peter Dalgaard
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



More information about the R-help mailing list