I have a df describing the number of visits a bird makes to it's nest over the summer. This includes a starttime and an endtime (POSIXct) for each visit.
df <- read.csv(text="
starttime,endtime,duration
2015-03-23 11:07:10,2015-03-23 17:57:10,420
2015-03-31 22:47:10,2015-04-01 06:47:10,490
2015-04-11 23:47:10,2015-04-12 06:17:10,400
2015-04-14 00:07:10,2015-04-15 06:27:10,1830
2015-06-23 02:17:10,2015-06-25 04:07:10,3000", stringsAsFactors=FALSE)
df$starttime <- as.POSIXct(df$starttime)
df$endtime <- as.POSIXct(df$endtime)
What I need to determine is whether each visit spans noon hour (12:00), regardless of the day of the visit. I also need to determine the number of times noon hour is passed in the case of multi-day visits.
I'm at a loss for where to start. Ideas?