Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ymdhTOjul

Convert to Julian dates.


Description

Converts YYYYMMDDHH or YYYYMMDD dates to Julian dates.

Usage

ymdhTOjul( YYYYMMDDHH, origin = c(month = 1, day = 1, year = 2000))

Arguments

YYYYMMDDHH

A character vector (or its factor equivalent) of dates in the form YYYYMMDDHH or YYYYMMDD, in which YYYY specifies the year, MM the month, DD the day, and (optionally) HH the hour.

origin

A named vector specifying the month, day, and year for the origin of the Julian dates. The default is c(month = 1, day = 1, year = 2000).

Details

Requires the chron library.

Value

A vector of Julian dates corresponding to YYYYMMDDHH. The vector has "origin" and "dropHour" attributes which give the origin for the Julian output and indicate whether or not the original format included the hour.

See Also

Examples

data(ensBMAtest)

  julianVdates <- ymdhTOjul(ensBMAtest$vdate)
  all.equal( julTOymdh(julianVdates), as.character(ensBMAtest$vdate))

  all.equal( ymdhTOjul(ensBMAtest$idate), julianVdates-2)

ensembleBMA

Probabilistic Forecasting using Ensembles and Bayesian Model Averaging

v5.1.5
GPL (>= 2)
Authors
Chris Fraley, Adrian E. Raftery, J. McLean Sloughter, Tilmann Gneiting, University of Washington.
Initial release
2018-01-18

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.