yday_366: Get the 366-based day of the year of a date

View source: R/yday_366.R

yday_366R Documentation

Get the 366-based day of the year of a date

Description

yday_366 returns an integer between 1 and 366 representing the day of the year number of x.

Usage

yday_366(x)

Arguments

x

A Date object

Details

In contrast to lubridate::yday, yday_366 considers the length of all years to be 366 days. In non leap years, there is no day 60 (29 February) and 1 March is always day 61.

This convention is often used for weather data and other applications. It's advantage is that all days have the same day number regardless of the year e.g. 31 December is always day 366, even in non leap years. This may be desirable, for example, when comparing day of year numbers across years that contain leap years and non leap years.

Value

An integer between 1 and 366 representing the day of the year number of x.

Examples

yday_366(as.Date("1999-03-01"))
yday_366(as.Date("2000-12-31"))
yday_366(as.Date("2005-12-31"))


IDEMSInternational/cdms.products documentation built on July 7, 2023, 10:13 a.m.