[R] How to preserve date format while aggregating

Erich Studerus erich.studerus at bli.uzh.ch
Mon Sep 8 12:38:47 CEST 2008


Hi

I have a dataframe in which some subjects appear in more than one row. I
want to extract the subject-rows which have the minimum date per subject. I
tried the following aggregate function.

attach(dataframe.xy)

aggregate(Date,list(SubjectID),min)

Unfortunately, the format of the Date-column changes to numeric, when I'm
applying this function. How can I preserve the date format?

Thanks

Erich



More information about the R-help mailing list