Re: [R] Date issues

2010-09-19 Thread Gabor Grothendieck
On Sun, Sep 19, 2010 at 1:31 AM, Santosh Srinivas 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 2009

Re: [R] Date issues

2010-09-18 Thread Henrik Bengtsson
_CTYPE=English_United > Kingdom.1252 > [3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C > > [5] LC_TIME=English_United Kingdom.1252 > > attached base packages: > [1] stats     graphics  grDevices utils     datasets  methods   base > > other attached packages: >

Re: [R] Date issues

2010-09-18 Thread Santosh Srinivas
COLLATE=English_United Kingdom.1252 LC_CTYPE=English_United Kingdom.1252 [3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C [5] LC_TIME=English_United Kingdom.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages:

Re: [R] Date issues

2010-09-18 Thread David Winsemius
On Sep 18, 2010, at 11:36 AM, David Winsemius wrote: 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 tak

Re: [R] Date issues

2010-09-18 Thread Santosh Srinivas
Thanks. -Original Message- From: David Winsemius [mailto:dwinsem...@comcast.net] Sent: 18 September 2010 21:07 To: Santosh Srinivas Cc: r-help@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 a

Re: [R] Date issues

2010-09-18 Thread Gabor Grothendieck
On Sat, 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 > Do you have zoo loaded? If you do then a minimal reproducible example (

Re: [R] Date issues

2010-09-18 Thread Marc Schwartz
On Sep 18, 2010, at 10: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 What version of R are you running? What is the output of: str(FnO_Data$D

Re: [R] Date issues

2010-09-18 Thread David Winsemius
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)

[R] Date issues

2010-09-18 Thread Santosh Srinivas
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 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read th