Hello, I cannot figure out where the problem is even after consulting the documentation for as.Date, although it must be a very silly thing. I have a character vector DD that contains dates:
unique(DD)
[1] NA "1999-01" "2013-08" "2013-02" "2013-03" "2013-01" "2013-07" "2012-12" "2013-05"
[10] "2012-11" "2013-04" "2013-06" "2011-11" "2011-12" "2011-06" "2010-07" "2011-01" "2010-03"
I want to convert it into date format. I tried
DD2 = as.Date(DD, format = "%Y-%m")
but the result gives only NAs :
unique(DD2)
[1] NA
Can anyone see the problem?