[This article was first published on Quantitative Ecology
, and kindly contributed to R-bloggers
]. (You can report issue about the content on this page here
Want to share your content on R-bloggers? click here
if you have a blog, or here
if you don't.
A quick function that when provided a numeric vector of years returns a boolean vector where TRUE == Leap year.
return(((year %% 4 == 0) & (year %% 100 != 0)) | (year %% 400 == 0))