我有一个简单的数据框。
a <- c("06/12/2012 06:00","06/12/2012 06:05","06/12/2012 06:10","06/12/2012 06:15","06/12/2012 06:20","06/12/2012 06:25",
"06/12/2012 06:30","06/12/2012 06:35","06/12/2012 06:40","06/12/2012 06:45","06/12/2012 06:50","06/12/2012 06:55",
"06/12/2012 07:00","06/12/2012 07:05","06/12/2012 07:10","06/12/2012 07:15","06/12/2012 07:20","06/12/2012 07:25",
"06/12/2012 07:30","06/12/2012 07:35","06/12/2012 07:40","06/12/2012 07:45","06/12/2012 07:50","06/12/2012 07:55",
"06/12/2012 08:00")
a <- strptime(a, "%d/%m/%Y %H:%M")
b <-c("1","0","0","0","2","0","0","0","3","0","0","0","0","0","1","2","5","6","0","0","0","0","6","10","2")
df1 <- data.frame(a,b)
当有效数据不足时,我想使用 R 删除部分数据框。每 5 分钟记录一次数据。如果在“b”列中仅记录零时有 20 分钟或更长时间的连续数据,则可以从我的最终数据框中删除这些数据。
如果有人有任何想法可以帮助我,我将非常感激。