[R] How to preserve date format while aggregating
jholtman at gmail.com
Mon Sep 8 14:24:07 CEST 2008
Try changing the 'class' of the numeric result back to Date:
> x <- as.Date('2008-09-08')
> y <- as.numeric(x)
> class(y) <- "Date"
Class 'Date' num 14130
On Mon, Sep 8, 2008 at 6:38 AM, Erich Studerus
<erich.studerus at bli.uzh.ch> wrote:
> 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.
> Unfortunately, the format of the Date-column changes to numeric, when I'm
> applying this function. How can I preserve the date format?
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
+1 513 646 9390
What is the problem that you are trying to solve?
More information about the R-help