I am using lubridate package to work with dates in R. I had an unexpected return from the isoyear() function.
library(lubridate)
isoyear("2014-12-31")
[1] 2015
year("2014-12-31")
[1] 2014
The isoyear() function says 2014-12-31 is in 2015, whereas 2015 says its in 2014. Obviously the return of year() is what I expected.
Could someone explain this difference in behaviour between isoyear and year? I can't think of any case where I would want the return of 2015 for 2014-12-31.