I have a very large time series dataset of electricity load from a substation which has been cleaned to have consistent time intervals of 15 minutes, however there are still large periods of missing data. The substation is split into individual feeders so is in the form:
Feeder <- c("F1","F1","F1","F1","F1", "F2","F2","F2","F2","F2", "F3","F3","F3","F3","F3")
Load <- c(3.1, NA, 4.0, 3.8, 3.6, 2.1, NA, 2.6, 2.9, 3.0, 2.4, NA, 2.3, 2.2, 2.5)
start <- as.POSIXct("2016-01-12 23:15:00")
end <- as.POSIXct("2016-01-13 00:15:00")
DateTimeseq <- seq(start, end, by = "15 min")
DateTime <- c(DateTimeseq, DateTimeseq, DateTimeseq)
dt <- data.frame(Feeder, Load, DateTime)
My actual data spans over a period of multiple years but I have condensed it down so it is easily replicable. As you can see, there are missing values. My actual dataset has large periods of missing data. In order to perform effective analysis, I need to find periods where there are no missing load data points for all feeders (ie. longest overlapping periods). If possible, I would like to generate a list of the longest overlapping periods without any NA values with the minimum being around 24 hours (I know this is not possible for the example I give but if you could show me how that would be great!). You could use a minimum of 15 minutes or something in this example.
As you can see from the simple data, the longest period would be 30 minutes between 2016-01-12 23:45:00 and 2016-01-13 00:15:00. However, in this example the second longest period would be 15 minutes but is inside the longest period. If possible, I would like to run it so it doesn't replicate values. If so, the second longest period in this case would be the overlapping point at 2016-01-12 23:15:00.
Feel free to play around with it and add more values if it would make it easier. It may be beneficial to create individual columns for the different feeders. I usually use pipes from dplyr but this is not essential. If you require anymore information do not hesitate to ask.
Thanks!