Skip to content
Prev 155334 / 398513 Next

How to preserve date format while aggregating

Thanks, I've already tried that. The problem is, that the original date is
not restored when I change the numeric back to date. I get a totally
different date.
Maybe it has something to do with the original date format. My data are
directly imported from a SQL-database. The date column to which I want to
apply the aggregate function has the two classes POSIXt and POSIXct.
Changing the column to class "Date" before applying the aggregate function
did not help. I still get a different date, when I transform it back to
class "Date".
I would be glad, if someone knew a more elegant way to extract the rows with
minimum/earliest date per subject. 


Erich


-----Urspr?ngliche Nachricht-----
Von: jim holtman [mailto:jholtman at gmail.com] 
Gesendet: Montag, 8. September 2008 14:24
An: Erich Studerus
Cc: r-help at r-project.org
Betreff: Re: [R] How to preserve date format while aggregating

Try changing the 'class' of the numeric result back to Date:
[1] "2008-09-08"
[1] 14130
num 14130
[1] "2008-09-08"
Class 'Date'  num 14130
On Mon, Sep 8, 2008 at 6:38 AM, Erich Studerus
<erich.studerus at bli.uzh.ch> wrote:
I
http://www.R-project.org/posting-guide.html