JDay_to_date: Transform JDay to date

View source: R/JDay_to_date.R

JDay_to_dateR Documentation

Transform JDay to date

Description

In agricultural assessments, the begining and end for a period of interest (e.g. chill accumulation) are often expressed as Julian days (JDay) or Day Of the Year (DOY). However, this makes difficult the interpretation of the results since most people are used to see dates. This function transform JDays into dates

Usage

JDay_to_date(JDay, year, date_format = "%Y-%m-%d", na.rm = FALSE)

Arguments

JDay

is a numeric vector of length = 1 or longer containing integers between 1 and 366

year

is a numeric input to define the year for which the JDay is transformed to date

date_format

is a character vector representing the format in which the date should be retrieved. For more options see as.Date

na.rm

is a boolean parameter used to skip the missing values. Default is set to NULL to produce an error in case the JDay vector contains some

Examples


JDay_to_date(JDay = 67 : 69, year = 2020, date_format = "%d.%m.%Y")

JDay_to_date(JDay = c(67, NA, 69), year = 2025, date_format = "%d.%m.%Y",
             na.rm = TRUE)


EduardoFernandezC/dormancyR documentation built on Aug. 24, 2022, 7:21 a.m.