I expect this is a repeat questions, but I have spent many hours now trying to find a solution, and would be very grateful for some help.
I have a the variable timestamp in a data frame, currently stored as a factor. timestamp is date and time in the format dd/mm/yyyy hh:mm:ss:ssssss
I would like to be able to subset the dataframe using the timestamp variable taking for instance all the rows between 09/10/2017 00:02:00 and 09/10/2017 00:06:00.
I have tried converting to an ordered factor, and to POSIXlt to help with the subsetting but had no success.
Thank you in advance for any help
df <- data.frame(timestamp=c("09/10/2017 00:00:00:000000", "09/10/2017 00:01:00:000000", "09/10/2017 00:02:00:000000",
"09/10/2017 00:03:00:000000", "09/10/2017 00:04:00:000000", "09/10/2017 00:05:00:000000",
"09/10/2017 00:06:00:000000", "09/10/2017 00:07:00:000000", "09/10/2017 00:08:00:000000",
"09/10/2017 00:09:00:000000", "09/10/2017 00:10:00:000000", "09/10/2017 00:00:00:000000",
"09/10/2017 00:01:00:000000", "09/10/2017 00:02:00:000000", "09/10/2017 00:03:00:000000",
"09/10/2017 00:04:00:000000", "09/10/2017 00:05:00:000000", "09/10/2017 00:06:00:000000",
"09/10/2017 00:07:00:000000", "09/10/2017 00:08:00:000000", "09/10/2017 00:09:00:000000",
"09/10/2017 00:10:00:000000"), b=c (1:22))
lubridate? - steveb