Dataset has column Connect.Time with the following structure:
$ Connect.Time : chr "7/11/2015 5:53 AM"
With lubridate package I change it to date with the hours & minutes mentioned. This code doesn't work and returns NA
W$Connect.Time <- as.Date(W$Connect.Time, format = "%m/%d/%Y %H:%M")
This gives me "2015-07-11" but R doesn't show the hours and minutes. When trying to extract them hour(W$Connect.Time) it'll give me 0 I'm not sure what to do with the AM/PM either. How to correctly parse it with lubridate package? I want to be able to calculate duration of WiFi sessions in minutes
as.Date
is not a lubridate function, but a base R. The lubridate functiondmy_hm(x)
works well. – SabDeM