[R] Date issues

Gabor Grothendieck ggrothendieck at gmail.com
Sun Sep 19 14:48:20 CEST 2010


On Sun, Sep 19, 2010 at 1:31 AM, Santosh Srinivas
<santosh.srinivas at gmail.com> wrote:
> I tried this and it works too (For most part) .... strangely for certain
> dates (20090831) it is giving NA ...
>
>> FnO_Data$Date[m:l]
>  [1] 20090828 20090828 20090828 20090828 20090828 20090828 20090828 20090828
> 20090828 20090828 20090828 20090828
> [13] 20090828 20090828 20090828 20090828 20090828 20090828 20090828 20090828
> 20090828 20090828 20090828 20090828
> [25] 20090828 20090828 20090828 20090828 20090828 20090828 20090828 20090828
> 20090828 20090828 20090831 20090831
> [37] 20090831 20090831 20090831 20090831 20090831 20090831 20090831 20090831
> 20090831 20090831 20090831 20090831
> [49] 20090831 20090831 20090831
>> as.Date(as.character(FnO_Data$Date[m:l]), format="%Y%M%d")

Its %m, not %M.

-- 
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com



More information about the R-help mailing list