doy2date: Convert DOYs to Dates

Description Usage Arguments Value See Also Examples

View source: R/doy2date.R

Description

Used to convert a vector of days of the year into a calendar date format, taking leap years into account.

Usage

1
doy2date(doy, year, leading_zero = FALSE, include_year = TRUE)

Arguments

doy

A numeric vector specifying the day of the year to convert.

year

A numeric vector specifying the year doy corresponds to. This is necessary to account for leap years. If only one element is provided it will be assumed that year corresponds to all DOY values provided to doy. Otherwise, year and doy must be the same length, and they will be matched elementwise.

leading_zero

logical: Do you wish to insert a zero in front of the month and day in the date if they are just single numbers (e.g., "6/1" would become "06/01" if set to TRUE). Defaults to FALSE.

include_year

logical: Do you wish to include the year in the output? Defaults to TRUE.

Value

A character vector containing the converted dates.

See Also

date2doy

Examples

1
2
3
doy2date(doy = c(151,152), year = 2016)
doy2date(doy = c(151,151), year = c(2015, 2016))
date2doy(51, 2017, TRUE)

bstaton1/StatonMisc documentation built on May 18, 2020, 12:06 a.m.