dttm.parse_dob_to_cols: Parse DOB to Separate Year, Month, Day Columns Create...

Description Usage Arguments Examples

View source: R/datetime.R

Description

Parse DOB to Separate Year, Month, Day Columns Create separate year, month, day columns from ymd or mdy formatted date.

Usage

1
dttm.parse_dob_to_cols(df, date_field, date_format = "ymd")

Arguments

df

data.frame or data.table with a date field.

date_field

Name of the date field/column.

date_format

Optional. Date field format. Either "ymd" (Year-Month-Day) or "mdy" (Month-Day-Year). Defaults to "ymd".

Examples

1
2
3
4
5
df_with_dob_column <- data.frame(dob = c("11/13/1968"))
df_with_parsed_dob <- dttm.parse_dob_to_cols(df_with_dob_column, date_field = "dob", date_format = "mdy")
df_with_parsed_dob
         dob birth_yr birth_mo birth_dy
1 11/13/1968     1968       11       13

dads2busy/dataplumbr documentation built on July 2, 2021, 3:24 a.m.