I'm trying to split a date and time column into separate day, month, hour, minute, second, day of week columns. I'm using the lubridate and mutuate function but when I try to use the below code I get this error: Warning message: All formats failed to parse. No formats found.
My new columns are created but they all contain NA's - wondering if someone can help?
My Column looks like this:
tpep_pickup_datetime
01/07/2019 00:51:15
01/07/2019 00:46:30
01/07/2019 00:25:35
and my code is this:
taxidata3 <- taxidata2 %>%
mutate(tpep_pickup_datetime = mdy_hms(tpep_pickup_datetime),
day = day(tpep_pickup_datetime),
month = month(tpep_pickup_datetime),
year = year(tpep_pickup_datetime),
dayofweek = wday(tpep_pickup_datetime),
hour = hour(tpep_pickup_datetime),
minute = minute(tpep_pickup_datetime),
second = second(tpep_pickup_datetime))
mdy_hms
is it month/day/ or day/month – akrundmy_hms
– akrun