[R] Date issues

Santosh Srinivas santosh.srinivas at gmail.com
Sat Sep 18 18:02:30 CEST 2010


Thanks.

-----Original Message-----
From: David Winsemius [mailto:dwinsemius at comcast.net] 
Sent: 18 September 2010 21:07
To: Santosh Srinivas
Cc: r-help at r-project.org
Subject: Re: [R] Date issues


On Sep 18, 2010, at 11:25 AM, Santosh Srinivas wrote:

> Strangely this is not working ... what am I doing wrong here?
>
>> tDate <- FnO_Data$Date[1]
>> tDate
> [1] 20090101
>> as.Date(c(tDate),format="%Y%m%d")
> [1] NA

?sasDate

as.Date does not take numeric arguments. Try:

 > as.Date(as.character(tDate), format="%Y%M%d")
[1] "2009-09-01"

-- 


David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list