Learn R Programming

lubridate (version 1.9.4)

decimal_date: Converts a date to a decimal of its year

Description

Converts a date to a decimal of its year

Usage

decimal_date(date)

Value

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

Arguments

date

a POSIXt or Date object

Examples

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

Run the code above in your browser using DataLab