Learn R Programming

WRTDStidal (version 1.1.4)

dec_time: Create decimal time from time vector

Description

Create decimal time on an annual scale from an input time vector

Usage

dec_time(date_in)

# S3 method for Date dec_time(date_in)

Value

A named list of four numeric vectors including day_num (decimal day on an annual scale), month (month of the year as integer), year, and dec_time (decimal time as sum of year and day_num)

Arguments

date_in

input time vector, usually a date object

Details

Function is used internally within the package.

Examples

Run this code
dt <- Sys.Date()
dts <- seq.Date(dt - 365, dt, by = 'day') 

dec_time(dts)

Run the code above in your browser using DataLab