ben519 / mltools

Exploratory and diagnostic machine learning tools for R
Other
72 stars 26 forks source link

date_factor() returns NA with type="yearquarter" and fullyears=FALSE #3

Closed ben519 closed 7 years ago

ben519 commented 7 years ago

Example

dts <- as.Date(c("2014-2-1", "2015-1-1", "2015-7-1"))
date_factor(dts, type="yearquarter", fullyears=FALSE)

[1] 2014 Q1 2015 Q1 <NA>   
Levels: 2014 Q1 < 2014 Q2 < 2014 Q3 < 2014 Q4 < 2015 Q1 < 2015 Q2