On Mon, Nov 22, 2010 at 3:39 PM, Tan, Richard wrote:
> Hi, I am trying to aggregate max a Date type column but have weird
> result, how do I fix this?
>
>> a <- rbind(
>
> + data.frame(name='Tom', payday=as.Date('1999-01-01')),
> + data.frame(name='Tom', payday=as.Date('2000-01-01')),
> + data.fra
onday, November 22, 2010 3:58 PM
To: Tan, Richard
Cc: r-help@r-project.org
Subject: Re: [R] aggregate a Date column does not work?
On Nov 22, 2010, at 3:54 PM, Tan, Richard wrote:
> Thanks, add as.Date('1970-01-01') to the result column works.
But that should make them all the same d
a$name), max)$x )
[1] "2000-01-01" "1999-01-01"
Richard
-Original Message-
From: David Winsemius [mailto:dwinsem...@comcast.net]
Sent: Monday, November 22, 2010 3:51 PM
To: Tan, Richard
Cc: r-help@r-project.org
Subject: Re: [R] aggregate a Date column does not work?
O
Thanks, add as.Date('1970-01-01') to the result column works.
Richard
-Original Message-
From: David Winsemius [mailto:dwinsem...@comcast.net]
Sent: Monday, November 22, 2010 3:51 PM
To: Tan, Richard
Cc: r-help@r-project.org
Subject: Re: [R] aggregate a Date column does not
On Nov 22, 2010, at 3:39 PM, Tan, Richard wrote:
Hi, I am trying to aggregate max a Date type column but have weird
result, how do I fix this?
In the process of getting max() you coerced the Dates to numeric and
now you need to re-coerce them back to Dates
?as.Date
as.Date() (possibly wi
Hi, I am trying to aggregate max a Date type column but have weird
result, how do I fix this?
> a <- rbind(
+ data.frame(name='Tom', payday=as.Date('1999-01-01')),
+ data.frame(name='Tom', payday=as.Date('2000-01-01')),
+ data.frame(name='Pete', payday=as.Date('1998-01-01')),
+ data.frame(n
6 matches
Mail list logo