Convert Column in Data Frame To Date
Examples
df <- data.frame(id = 1:2, date = c("2018-10-23", "2018-10-23"))
str(df)
#> 'data.frame': 2 obs. of 2 variables:
#> $ id : int 1 2
#> $ date: chr "2018-10-23" "2018-10-23"
df <- columnToDate(df, "date")
#> Converting column 'date' to Date ... ok. (0.00 secs)
str(df)
#> 'data.frame': 2 obs. of 2 variables:
#> $ id : int 1 2
#> $ date: Date, format: "2018-10-23" "2018-10-23"