[R] Date from text

Poizot Emmanuel emm@nue|@po|zot @end|ng |rom |ecn@m@net
Fri May 15 11:38:31 CEST 2020


Dear all,

I've a data frame with a column "Date":

[1] 11-1993 11-1993 11-1993 11-1993 11-1993 11-1993 11-1996 11-1996 11-1996
[10] 11-1996 11-1996 11-1996 02-1998 02-1998 02-1998 02-1998 02-1998 02-1998
[19] 11-1998 11-1998 11-1998 11-1998 11-1998 11-1998 10-2001 10-2001 10-2001
[28] 10-2001 10-2001 10-2001 02-2003 02-2003 02-2003 02-2003 02-2003 02-2003
[37] 11-2004 11-2004 11-2004 11-2004 11-2004 11-2004 11-2005 11-2005 11-2005
[46] 11-2005 11-2005 11-2005 11-2007 11-2007 11-2007 11-2007 11-2007 11-2007
[55] 10-2008 10-2008 10-2008 10-2008 10-2008 10-2008 03-2009 03-2009 03-2009
[64] 03-2009 03-2009 03-2009 10-2012 10-2012 10-2012 10-2012 10-2012 10-2012
[73] 12-2017 12-2017 12-2017 12-2017 12-2017 12-2017 12-2018 12-2018 12-2018
[82] 12-2018 12-2018 12-2018

I want to convert that into real dates:
as.POSIXct(Date, format="%m-%Y") always return "NA" values.
Where am I wrong ?

regards


More information about the R-help mailing list