这是一个可能的错误factor
还是我在这里遗漏了什么?
xx <- seq.Date(Sys.Date(), length.out=5, by="1 day")
factor(xx) # Works fine!
[1] 2013-07-12 2013-07-13 2013-07-14 2013-07-15 2013-07-16
Levels: 2013-07-12 2013-07-13 2013-07-14 2013-07-15 2013-07-16
factor(xx, levels=unique(xx)) # Generates NAs.
[1] <NA> <NA> <NA> <NA> <NA>
Levels: 2013-07-12 2013-07-13 2013-07-14 2013-07-15 2013-07-16