rip_yday() extracts the day of the year from a date or datetime object.

rip_yday(x)

Arguments

x

<Date / POSIXct / POSIXlt>

The vector to extract the day of the year from.

Value

An integer vector the same size as x containing the day of the year values.

Examples

# Identical dates, but in different days of the year x <- as.POSIXct("1969-12-31 19:00:00", tz = "America/New_York") y <- as.POSIXct("1970-01-01 00:00:00", tz = "UTC") identical(as.numeric(x), as.numeric(y))
#> [1] TRUE
rip_yday(x)
#> [1] 365
rip_yday(y)
#> [1] 1