I'm missing something obvious with the "format" section of as.Date. Consider this example
d1 <- data.frame(d = c("1/Jan/1947",
"1/Feb/1947",
"1/Mar/1947"),
d2 = c("Jan/1947",
"Feb/1947",
"Mar/1947"))
d1$date1 <- as.Date(x=d1$d, format="%d/%b/%Y")
d1$date2 <- as.Date(x=d1$d2, format="%b/%Y")
d d2 date1 date2
1 1/Jan/1947 Jan/1947 1947-01-01 <NA>
2 1/Feb/1947 Feb/1947 1947-02-01 <NA>
3 1/Mar/1947 Mar/1947 1947-03-01 <NA>
so my question is really simple -- I don't understand why the date1 works but date2 doesn't.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…