is_leap_year: Determine if a year is a leap year

Description Usage Arguments Details Value Examples

View source: R/is_leap_year.R

Description

Used to determine if each element in a vector of years is a leap year.

Usage

1

Arguments

date

a numeric vector of length >= 1 containing the years to test

Details

a year is considered a leap year if it is divisible by 4 and not divisible by 100. The exception is years that are divisible by 400 are also considered leap years.

Value

a logical vector indicating whether each year is a leap year (TRUE if so, FALSE if not).

Examples

1
is_leap_year(2016:2020)

bstaton1/StatonMisc documentation built on May 18, 2020, 12:06 a.m.