make_date_cols: Function to add "year_of" and "month_of" columns to a...

Description Usage Arguments Value Examples

View source: R/date-helpers.R

Description

Function to add "year_of" and "month_of" columns to a dataframe

Usage

1
make_date_cols(df, date_col)

Arguments

df

A data frame with a date column

date_col

The unquoted name of the date column

Value

A data frame with the new date columns.

Examples

1
2
3
4
5
df <- data_frame(date_of = seq.Date(as.Date("2000-01-01"),
                                    as.Date("2000-12-01"),
                                    by = "1 month"),
                 x = runif(12))
make_date_cols(df, date_of)

amboseli/ramboseli documentation built on March 18, 2021, 12:03 a.m.