A quick function that when provided a numeric vector of years returns a boolean vector where TRUE == Leap year.

is.leapyear**=**function(year){

*#http://en.wikipedia.org/wiki/Leap_year*

**return**(((year %% 4 == 0) & (year %% 100 != 0)) | (year %% 400 == 0))

}

*Related*

To

**leave a comment** for the author, please follow the link and comment on their blog:

** Quantitative Ecology**.

R-bloggers.com offers

**daily e-mail updates** about

R news and

tutorials on topics such as:

Data science,

Big Data, R jobs, visualization (

ggplot2,

Boxplots,

maps,

animation), programming (

RStudio,

Sweave,

LaTeX,

SQL,

Eclipse,

git,

hadoop,

Web Scraping) statistics (

regression,

PCA,

time series,

trading) and more...

If you got this far, why not

__subscribe for updates__ from the site? Choose your flavor:

e-mail,

twitter,

RSS, or

facebook...