Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

isLeapYear

Check Leap Year


Description

Checks whether or not the elements of its input are leap years.

Usage

isLeapYear(y)

Arguments

y

numeric vector of years

Details

y is a leap year if it is evenly divisible by 4 and either it is not evenly divisible by 100 or it is evenly divisible by 400, i.e., y%%4 == 0 & (y%%100 != 0 | y%%400 == 0).

Value

logical vector of same length as y indicating whether or not the given years are leap years.

Examples

isLeapYear(c(1899:2004))

tis

Time Indexes and Time Indexed Series

v1.38
Unlimited
Authors
Jeff Hallman <jeffhallman@gmail.com>
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.