add_date function

Add date/time column to data.frame

Add date/time column to data.frame

Takes the Year, Month, Day and, if available, Hour, Minute and Second columns of a data.frame and uses them to produce a Date column that uses R's standard data/time format.

add_date(df)

Arguments

  • df: Data frame containing columns Year, Month, Day and - optionally - Hour, Minute and/or Second

Returns

data.frame consisting of the df input and a new column Date

Details

Converts YEARMODA to R date

Examples

add_date(KA_weather) add_date(Winters_hours_gaps)

Author(s)

Eike Luedeling

  • Maintainer: Eike Luedeling
  • License: GPL-3
  • Last published: 2024-11-14

Useful links