fix_dates: Converts columns with dates into a R date class

Description Usage Arguments Examples

Description

Using lubridate, this function will transform dates from mdy, mdy_h, mdy_hm, mdy_hms (or starting with day instead of month) into valid date classes. It will return an error it if cannot coerce the date itself.

Usage

1

Arguments

df

The input data.frame

date

The column name containing the dates

format

The format of the date.

Examples

1
2
3
4
## Not run: 
new <- fix_dates(goat_data, 'start.date', 'dmy')

## End(Not run)

Hackout2/mapData documentation built on May 6, 2019, 9:48 p.m.