mmddyyyy_to_numeric: mm/dd/yyyy to julian date helper function

Description Usage Arguments Value Examples

View source: R/incoming_data.R

Description

The rnoaa package returns dates in the station list in "mm/dd/yyyy" format, and we (Wang & Dillon) formatted our dates in a similar way. All date and spectral calculations work on multi-year Julian dates. This is a small helper function to convert from "mm/dd/yyyy" to julian day. Because it uses mdy.date() from the date package, it returns the number of days since January 1, 1960. Inputs are coerced to character if necessary.

Usage

1
mmddyyyy_to_numeric(mmddyyyy_dates = stop("Char dates mm/dd/yyyy rqrd."))

Arguments

mmddyyyy_dates

a vector of dates in "mm/dd/yyyy" format.

Value

a numeric vector of the number of days since 1/1/1960, dates before this are negative.

Examples

1
mmddyyyy_to_numeric(c("3/5/1954", "9/28/2012"))

georgebiogeekwang/tempcycles documentation built on May 17, 2019, 1:15 a.m.