Description Usage Arguments Details Examples
It follows the established rules to figure out if is a leap year (https://en.wikipedia.org/wiki/Leap_year). It uses astronomial year numbering for years before the Gregorian calendar was established. (https://en.wikipedia.org/wiki/Astronomical_year_numbering)
1 | is_leap_year(year)
|
year |
The year to evaluate. It expects a integer number. It also expects the astronomical number of years older than 1. For example, to evaluate year 401 BCE, use -400. |
The year is designated as leap if: the year number is divisible by 400, or if the year number is divisible by 4, but it is not divisible by 100.
1 2 3 4 | is_leap_year(2012)
is_leap_year(-401)
# To evaluate multiple years
as.integer(lapply(2000:2005, is_leap_year))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.