As.Date - charToDate(x)

时间:2014-02-06 18:44:45

标签: r date

任何人都可以向我解释这种行为。我好像在这里感到困惑。 为什么“2013-12-31”有效,但不是“2013-11-31”?

as.Date("2013-11-31")
Error in charToDate(x) : 
  character string is not in a standard unambiguous format
as.Date("2013-12-31")
[1] "2013-12-31"

as.Date("2013-11-31",format="%Y-%m-%d")
[1] NA
as.Date("2013-12-31",format="%Y-%m-%d")
[1] "2013-12-31"

感谢。

0 个答案:

没有答案