Skip to contents

Gets decimal year values for date/time vectors.

Usage

dtt_year_decimal(x, ...)

# S3 method for class 'Date'
dtt_year_decimal(x, ...)

# S3 method for class 'POSIXct'
dtt_year_decimal(x, ...)

Arguments

x

A date/time vector.

...

Unused.

Value

A numeric vector.

Methods (by class)

  • dtt_year_decimal(Date): Get numeric vector of decimal year values for a Date vector

  • dtt_year_decimal(POSIXct): Get numeric vector of decimal year values for a POSIXct vector

Examples

x <- as.Date("1990-01-02")
dtt_year_decimal(x)
#> [1] 1990.003