date_from_day_year {cropgrowdays} | R Documentation |
Calculate a date from the day of the year and the year
Description
date_from_day_of_year
returns the date using the day of the
year and a year for a calendar or financial year. The first day of
the year is 1 January for the calendar year, 1 July for the
Australian financial year or can be specified. Alternatively, the
first day of the year can be any day of the year if desired.
Usage
date_from_day_year(
day,
year,
type = c("calendar", "financial", "other"),
base = NULL
)
Arguments
day |
Day as an |
year |
Year as an |
type |
A character string specifying the type of
year. “calendar” is a calendar year starting on 1
January, “financial” an Australian financial year
beginning on 1 July and “other” is for a year starting on
another date which is specified in |
base |
A |
Value
A date of class Date
calculated from
the day of the year and the year
Examples
library(lubridate)
date_from_day_year(day = 366, year = 2020)
date_from_day_year(21,2021)
date_from_day_year(day = c(21, 24, 30), year = rep(2021, 3))
date_from_day_year(21,2021, type = "financial")
date_from_day_year(21,2021, type = "other", base = list(d=1, m=9))