decimal_date: Converts a date to a decimal of its year

View source: R/decimal-dates.r

decimal_dateR Documentation

Converts a date to a decimal of its year

Description

Converts a date to a decimal of its year

Usage

decimal_date(date)

Arguments

date

a POSIXt or Date object

Value

a numeric object where the date is expressed as a fraction of its year

Examples

date <- ymd("2009-02-10")
decimal_date(date) # 2009.11

hadley/lubridate documentation built on Feb. 3, 2024, 9:37 a.m.