Learn R Programming

chillR (version 0.75)

leap_year: Leap year finder

Description

This function determines whether a given year is a leap year

Usage

leap_year(x)

Value

boolean variable (TRUE or FALSE)

Arguments

x

integer value, representing year number

Author

Eike Luedeling, but based on pseudocode from Wikipedia

Details

Takes a year number as input, and returns TRUE if this is a leap year, and FALSE if not

References

https://en.wikipedia.org/wiki/Leap_year

Examples

Run this code


leap_year(2015)  
leap_year(2016)

 

Run the code above in your browser using DataLab