compute_day_from_date {SticsRFiles} | R Documentation |
Convert date into day number
Description
Computes the day number corresponding to a given date (or vector of) from the first day of a start year. Typically, the start year should be the year of a STICS simulation start. Leap years are properly handled.
Usage
compute_day_from_date(
date,
start_year = NULL,
start_date = lifecycle::deprecated()
)
Arguments
date |
date(s) vector to be converted,
in the character format ("YYYY-MM-DD") or |
start_year |
year to be used as time reference (simulation start year). Optional. |
start_date |
Value
numeric vector
Author(s)
Timothee Flutre
Examples
date <- as.Date("2015-02-10")
compute_day_from_date(date = date)
compute_day_from_date(date = "2015-02-10", start_year = 2014)
date <- as.Date("2009-02-10")
compute_day_from_date(date = date, start_year = 2008 )
dates <- c(as.Date("2008-02-10"), as.Date("2009-02-10"))
compute_day_from_date(date = dates, start_year = 2008 )
[Package SticsRFiles version 1.4.0 Index]