x1 <- as.Date(c("2000-01-01", "2000-01-01"))
as.yearmon2(x1)
#Warning message:
#In as.yearmon2(x1) :
# 1 duplicate months found in 'x'; returning 'x' unchanged
x2 <- as.Date(c("2000-01-01", "2000-02-01"))
as.yearmon2(x2)
# month of x2 with names x2
Run the code above in your browser using DataLab