doy_2md: Converting day of year number to month and day

View source: R/doy_2md.R

doy_2mdR Documentation

Converting day of year number to month and day

Description

Translates numbers into human-readable day and month, useful when working with phenology data. Note that this function treats decimals as their floor, so doy_2md(doy = 5.8) returns "January 05". By default, assumes a non-leap-year.

Usage

doy_2md(doy, short = FALSE, leap = FALSE)

Arguments

doy

numeric or vector of numerics representing the day of year.

short

Do we want months abbreviated? Defaults to FALSE; if TRUE, longer month names like January will be represented with their abbreviations. Useful for axes labels.

leap

Do we want to assume a leap year? Defaults to FALSE; if TRUE, uses a 29-day February.

Value

A character string or vector of strings, with human readable day/month.

Examples

doy_2md(18)
doy_2md(c(15, 29.8, 180))
doy_2md(c(15, 29.8, 180), short=TRUE)

cbedwards/cedwards documentation built on Feb. 24, 2023, 6:53 p.m.