decimal_date: Converts a date to a decimal of its year

Description Usage Arguments Value Examples

View source: R/decimal-dates.r

Description

Converts a date to a decimal of its year

Usage

1

Arguments

date

a POSIXt or Date object

Value

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

Examples

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

Example output

Attaching package: 'lubridate'

The following object is masked from 'package:base':

    date

[1] 2009.11

lubridate documentation built on Nov. 17, 2017, 6:56 a.m.