yyyymmdd_to_numeric: yyyy-mm-dd to julian date helper function

Description Usage Arguments Value Examples

View source: R/incoming_data.R

Description

The rnoaa package returns dates for weather station records in "yyyy-mm-dd" format. All date and spectral calculations work on multi-year Julian dates. This is a small helper function to convert from "yyyy-mm-dd" 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
yyyymmdd_to_numeric(yyyymmdd_dates = stop("Char dates yyyy-mm-dd rqrd."))

Arguments

yyyymmdd_dates

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

Value

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

Examples

1
yyyymmdd_to_numeric(c("1954-3-5", "2012-9-28"))

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