Hello,
I have a time series with one variable naturally being date/time.
I split the date/time into 2 variables one being date and the other time using
temp_HR=temp_HR%>%mutate(date=as.Date(recorded_dttm))
temp_HR=temp_HR%>%mutate (time=format(as.POSIXct(recorded_dttm) ,format = "%H:%M:%S"))
now, I want to create a new variable with the time difference between consecutive elements. However the time variable generated above is in character format.
thank you. for some reason the intervals don't make sense in my case
for example the difference between 2018-08-21 17:04:00 and 2018-08-21 17:15:00 is coming out as 660.