dot-appendDateFeatures: Appends date features to data frame

.appendDateFeaturesR Documentation

Appends date features to data frame

Description

Appends date features to data frame. Creates new column 'date' based on var if date is not already in the data frame. The newly created (or existing) date column is truncated to day. Columns for year, day of year (doy), decimal year (dyear), and month are added based on date. This function relies on smwrBase::baseDay and smwrBase::baseDay2decimal for doy and decimal year.

The baseDay and baseDay2decimal functions have been added to this package from smwrBase package.

Usage

.appendDateFeatures(df, var = "date")

Arguments

df

data frame

var

variable with stored date

Value

Returns data frame with appended date features including year, doy, decimal year, and month


baytrends documentation built on May 31, 2023, 8:38 p.m.