如何检查常数?

时间:2019-02-11 06:54:05

标签: r

structure(list(Date_Time = structure(c(235L, 235L, 235L, 235L, 252L, 252L, 252L, 252L, 253L, 253L), .Label = c("1/1/2019 0:10", "1/1/2019 0:25", "1/1/2019 0:40", "1/1/2019 0:55", "1/1/2019 1:10", "1/1/2019 1:25", "1/1/2019 1:40", "1/1/2019 1:55", "1/1/2019 10:10", "1/1/2019 10:25", "1/1/2019 10:40", "1/1/2019 10:55", "1/1/2019 11:10", "1/1/2019 11:25", "1/1/2019 11:40", "1/1/2019 11:55", "1/1/2019 12:10", "1/1/2019 12:25", "1/1/2019 12:40", "1/1/2019 12:55", "1/1/2019 13:10", "1/1/2019 13:25", "1/1/2019 13:40", "1/1/2019 13:55", "1/1/2019 14:10", "1/1/2019 14:25", "1/1/2019 14:40", "1/1/2019 14:55", "1/1/2019 15:10", "1/1/2019 15:25", "1/1/2019 15:40", "1/1/2019 15:55", "1/1/2019 16:10", "1/1/2019 16:25", "1/1/2019 16:40", "1/1/2019 16:55", "1/1/2019 17:10", "1/1/2019 17:25", "1/1/2019 17:40", "1/1/2019 17:55", "1/1/2019 18:10", "1/1/2019 18:25", "1/1/2019 18:40", "1/1/2019 18:55", "1/1/2019 19:10", "1/1/2019 19:25", "1/1/2019 19:40", "1/1/2019 19:55", "1/1/2019 2:10", "1/1/2019 2:25", "1/1/2019 2:40", "1/1/2019 2:55", "1/1/2019 20:10", "1/1/2019 20:25", "1/1/2019 20:40", "1/1/2019 20:55", "1/1/2019 21:10", "1/1/2019 21:25", "1/1/2019 21:40", "1/1/2019 21:55", "1/1/2019 22:10", "1/1/2019 22:25", "1/1/2019 22:40", "1/1/2019 22:55", "1/1/2019 23:10", "1/1/2019 23:25", "1/1/2019 23:40", "1/1/2019 23:55", "1/1/2019 3:10", "1/1/2019 3:25", "1/1/2019 3:40", "1/1/2019 3:55", "1/1/2019 4:10", "1/1/2019 4:25", "1/1/2019 4:40", "1/1/2019 4:55", "1/1/2019 5:10", "1/1/2019 5:25", "1/1/2019 5:40", "1/1/2019 5:55", "1/1/2019 6:10", "1/1/2019 6:25", "1/1/2019 6:40", "1/1/2019 6:55", "1/1/2019 7:10", "1/1/2019 7:25", "1/1/2019 7:40", "1/1/2019 7:55", "1/1/2019 8:10", "1/1/2019 8:25", "1/1/2019 8:40", "1/1/2019 8:55", "1/1/2019 9:10", "1/1/2019 9:25", "1/1/2019 9:40", "1/1/2019 9:55", "1/2/2019 0:10", "1/2/2019 0:25", "1/2/2019 0:40", "1/2/2019 0:55", "1/2/2019 1:10", "1/2/2019 1:25", "1/2/2019 1:40", "1/2/2019 1:55", "1/2/2019 10:10", "1/2/2019 10:25", "1/2/2019 10:40", "1/2/2019 10:55", "1/2/2019 11:10", "1/2/2019 11:25", "1/2/2019 11:40", "1/2/2019 11:41", "1/2/2019 11:55", "1/2/2019 12:10", "1/2/2019 12:25", "1/2/2019 12:40", "1/2/2019 12:55", "1/2/2019 13:10", "1/2/2019 13:25", "1/2/2019 13:40", "1/2/2019 13:55", "1/2/2019 14:10", "1/2/2019 14:25", "1/2/2019 14:40", "1/2/2019 14:55", "1/2/2019 15:10", "1/2/2019 15:25", "1/2/2019 15:40", "1/2/2019 15:55", "1/2/2019 16:10", "1/2/2019 16:25", "1/2/2019 16:40", "1/2/2019 16:55", "1/2/2019 17:10", "1/2/2019 17:25", "1/2/2019 17:40", "1/2/2019 17:55", "1/2/2019 18:10", "1/2/2019 18:25", "1/2/2019 18:40", "1/2/2019 18:55", "1/2/2019 19:10", "1/2/2019 19:25", "1/2/2019 19:40", "1/2/2019 19:55", "1/2/2019 2:10", "1/2/2019 2:25", "1/2/2019 2:40", "1/2/2019 2:55", "1/2/2019 20:10", "1/2/2019 20:25", "1/2/2019 20:40", "1/2/2019 20:55", "1/2/2019 21:10", "1/2/2019 21:25", "1/2/2019 21:40", "1/2/2019 21:55", "1/2/2019 22:10", "1/2/2019 22:25", "1/2/2019 22:40", "1/2/2019 22:55", "1/2/2019 23:10", "1/2/2019 23:25", "1/2/2019 23:40", "1/2/2019 23:55", "1/2/2019 3:10", "1/2/2019 3:25", "1/2/2019 3:40", "1/2/2019 3:55", "1/2/2019 4:10", "1/2/2019 4:25", "1/2/2019 4:40", "1/2/2019 4:55", "1/2/2019 5:10", "1/2/2019 5:25", "1/2/2019 5:40", "1/2/2019 5:55", "1/2/2019 6:10", "1/2/2019 6:25", "1/2/2019 6:40", "1/2/2019 6:55", "1/2/2019 7:10", "1/2/2019 7:25", "1/2/2019 7:40", "1/2/2019 7:55", "1/2/2019 8:10", "1/2/2019 8:25", "1/2/2019 8:40", "1/2/2019 8:55", "1/2/2019 9:10", "1/2/2019 9:25", "1/2/2019 9:26", "1/2/2019 9:40", "1/2/2019 9:55", "12/27/2018 10:10", "12/27/2018 10:25", "12/27/2018 10:40", "12/27/2018 10:55", "12/27/2018 11:10", "12/27/2018 11:25", "12/27/2018 11:40", "12/27/2018 11:55", "12/27/2018 12:10", "12/27/2018 12:25", "12/27/2018 12:40", "12/27/2018 12:55", "12/27/2018 13:10", "12/27/2018 13:25", "12/27/2018 13:40", "12/27/2018 13:55", "12/27/2018 14:10", "12/27/2018 14:25", "12/27/2018 14:40", "12/27/2018 14:55", "12/27/2018 15:10", "12/27/2018 15:25", "12/27/2018 15:40", "12/27/2018 15:55", "12/27/2018 16:10", "12/27/2018 16:25", "12/27/2018 16:40", "12/27/2018 16:55", "12/27/2018 17:10", "12/27/2018 17:25", "12/27/2018 17:40", "12/27/2018 17:55", "12/27/2018 18:10", "12/27/2018 18:25", "12/27/2018 18:40", "12/27/2018 18:55", "12/27/2018 19:10", "12/27/2018 19:25", "12/27/2018 19:40", "12/27/2018 19:55", "12/27/2018 2:55", "12/27/2018 20:10", "12/27/2018 20:25", "12/27/2018 20:40", "12/27/2018 20:55", "12/27/2018 21:10", "12/27/2018 21:25", "12/27/2018 21:40", "12/27/2018 21:55", "12/27/2018 22:10", "12/27/2018 22:25", "12/27/2018 22:40", "12/27/2018 22:55", "12/27/2018 23:10", "12/27/2018 23:25", "12/27/2018 23:40", "12/27/2018 23:55", "12/27/2018 3:10", "12/27/2018 3:25", "12/27/2018 3:40", "12/27/2018 3:55", "12/27/2018 4:10", "12/27/2018 4:25", "12/27/2018 4:40", "12/27/2018 4:55", "12/27/2018 5:10", "12/27/2018 5:25", "12/27/2018 5:40", "12/27/2018 5:55", "12/27/2018 6:10", "12/27/2018 6:25", "12/27/2018 6:40", "12/27/2018 6:55", "12/27/2018 7:10", "12/27/2018 7:25", "12/27/2018 7:40", "12/27/2018 7:55", "12/27/2018 8:10", "12/27/2018 8:25", "12/27/2018 8:40", "12/27/2018 8:55", "12/27/2018 9:10", "12/27/2018 9:25", "12/27/2018 9:40", "12/27/2018 9:55", "12/28/2018 0:10", "12/28/2018 0:25", "12/28/2018 0:40", "12/28/2018 0:55", "12/28/2018 1:10", "12/28/2018 1:25", "12/28/2018 1:40", "12/28/2018 1:55", "12/28/2018 10:10", "12/28/2018 10:25", "12/28/2018 10:40", "12/28/2018 10:55", "12/28/2018 11:10", "12/28/2018 11:25", "12/28/2018 11:40", "12/28/2018 11:55", "12/28/2018 12:10", "12/28/2018 12:25", "12/28/2018 12:40", "12/28/2018 12:55", "12/28/2018 13:10", "12/28/2018 13:25", "12/28/2018 13:40", "12/28/2018 13:55", "12/28/2018 14:10", "12/28/2018 14:25", "12/28/2018 14:40", "12/28/2018 14:55", "12/28/2018 15:10", "12/28/2018 15:25", "12/28/2018 15:40", "12/28/2018 15:55", "12/28/2018 16:10", "12/28/2018 16:25", "12/28/2018 16:40", "12/28/2018 16:55", "12/28/2018 17:10", "12/28/2018 17:25", "12/28/2018 17:40", "12/28/2018 17:55", "12/28/2018 18:10", "12/28/2018 18:25", "12/28/2018 18:40", "12/28/2018 18:55", "12/28/2018 19:10", "12/28/2018 19:25", "12/28/2018 19:40", "12/28/2018 19:55", "12/28/2018 2:10", "12/28/2018 2:25", "12/28/2018 2:40", "12/28/2018 2:55", "12/28/2018 20:10", "12/28/2018 20:25", "12/28/2018 20:40", "12/28/2018 20:55", "12/28/2018 21:10", "12/28/2018 21:25", "12/28/2018 21:40", "12/28/2018 21:55", "12/28/2018 22:10", "12/28/2018 22:25", "12/28/2018 22:40", "12/28/2018 22:55", "12/28/2018 23:10", "12/28/2018 23:25", "12/28/2018 23:40", "12/28/2018 23:55", "12/28/2018 3:10", "12/28/2018 3:25", "12/28/2018 3:40", "12/28/2018 3:55", "12/28/2018 4:10", "12/28/2018 4:11", "12/28/2018 4:25", "12/28/2018 4:40", "12/28/2018 4:55", "12/28/2018 5:10", "12/28/2018 5:25", "12/28/2018 5:40", "12/28/2018 5:55", "12/28/2018 6:10", "12/28/2018 6:25", "12/28/2018 6:40", "12/28/2018 6:55", "12/28/2018 7:10", "12/28/2018 7:25", "12/28/2018 7:40", "12/28/2018 7:55", "12/28/2018 8:10", "12/28/2018 8:25", "12/28/2018 8:40", "12/28/2018 8:55", "12/28/2018 9:10", "12/28/2018 9:25", "12/28/2018 9:40", "12/28/2018 9:55", "12/29/2018 0:10", "12/29/2018 0:25", "12/29/2018 0:40", "12/29/2018 0:55", "12/29/2018 1:10", "12/29/2018 1:25", "12/29/2018 1:40", "12/29/2018 1:55", "12/29/2018 10:10", "12/29/2018 10:25", "12/29/2018 10:40", "12/29/2018 10:55", "12/29/2018 11:10", "12/29/2018 11:25", "12/29/2018 11:40", "12/29/2018 11:55", "12/29/2018 12:10", "12/29/2018 12:25", "12/29/2018 12:40", "12/29/2018 12:55", "12/29/2018 13:10", "12/29/2018 13:25", "12/29/2018 13:40", "12/29/2018 13:55", "12/29/2018 14:10", "12/29/2018 14:25", "12/29/2018 14:40", "12/29/2018 14:55", "12/29/2018 15:10", "12/29/2018 15:25", "12/29/2018 15:40", "12/29/2018 15:55", "12/29/2018 16:10", "12/29/2018 16:25", "12/29/2018 16:40", "12/29/2018 16:55", "12/29/2018 17:10", "12/29/2018 17:25", "12/29/2018 17:40", "12/29/2018 17:55", "12/29/2018 18:10", "12/29/2018 18:25", "12/29/2018 18:40", "12/29/2018 18:55", "12/29/2018 19:10", "12/29/2018 19:25", "12/29/2018 19:40", "12/29/2018 19:55", "12/29/2018 2:10", "12/29/2018 2:25", "12/29/2018 2:40", "12/29/2018 2:55", "12/29/2018 20:10", "12/29/2018 20:25", "12/29/2018 20:40", "12/29/2018 20:55", "12/29/2018 21:10", "12/29/2018 21:25", "12/29/2018 21:40", "12/29/2018 21:55", "12/29/2018 22:10", "12/29/2018 22:25", "12/29/2018 22:40", "12/29/2018 22:55", "12/29/2018 23:10", "12/29/2018 23:25", "12/29/2018 23:40", "12/29/2018 23:55", "12/29/2018 3:10", "12/29/2018 3:25", "12/29/2018 3:40", "12/29/2018 3:55", "12/29/2018 4:10", "12/29/2018 4:25", "12/29/2018 4:40", "12/29/2018 4:55", "12/29/2018 5:10", "12/29/2018 5:25", "12/29/2018 5:40", "12/29/2018 5:55", "12/29/2018 6:10", "12/29/2018 6:25", "12/29/2018 6:40", "12/29/2018 6:55", "12/29/2018 7:10", "12/29/2018 7:25", "12/29/2018 7:40", "12/29/2018 7:55", "12/29/2018 8:10", "12/29/2018 8:25", "12/29/2018 8:40", "12/29/2018 8:55", "12/29/2018 9:10", "12/29/2018 9:25", "12/29/2018 9:40", "12/29/2018 9:55", "12/30/2018 0:10", "12/30/2018 0:25", "12/30/2018 0:40", "12/30/2018 0:55", "12/30/2018 1:10", "12/30/2018 1:25", "12/30/2018 1:40", "12/30/2018 1:55", "12/30/2018 10:10", "12/30/2018 10:25", "12/30/2018 10:40", "12/30/2018 10:55", "12/30/2018 11:10", "12/30/2018 11:25", "12/30/2018 11:40", "12/30/2018 11:55", "12/30/2018 12:10", "12/30/2018 12:25", "12/30/2018 12:40", "12/30/2018 12:55", "12/30/2018 13:10", "12/30/2018 13:25", "12/30/2018 13:40", "12/30/2018 13:55", "12/30/2018 14:10", "12/30/2018 14:25", "12/30/2018 14:40", "12/30/2018 14:55", "12/30/2018 15:10", "12/30/2018 15:25", "12/30/2018 15:40", "12/30/2018 15:55", "12/30/2018 16:10", "12/30/2018 16:25", "12/30/2018 16:40", "12/30/2018 16:55", "12/30/2018 17:10", "12/30/2018 17:25", "12/30/2018 17:40", "12/30/2018 17:55", "12/30/2018 18:10", "12/30/2018 18:25", "12/30/2018 18:40", "12/30/2018 18:55", "12/30/2018 19:10", "12/30/2018 19:25", "12/30/2018 19:40", "12/30/2018 19:55", "12/30/2018 2:10", "12/30/2018 2:25", "12/30/2018 2:40", "12/30/2018 2:55", "12/30/2018 20:10", "12/30/2018 20:25", "12/30/2018 20:40", "12/30/2018 20:55", "12/30/2018 21:10", "12/30/2018 21:25", "12/30/2018 21:40", "12/30/2018 21:55", "12/30/2018 22:10", "12/30/2018 22:25", "12/30/2018 22:40", "12/30/2018 22:55", "12/30/2018 23:10", "12/30/2018 23:25", "12/30/2018 23:40", "12/30/2018 23:55", "12/30/2018 3:10", "12/30/2018 3:25", "12/30/2018 3:40", "12/30/2018 3:55", "12/30/2018 4:10", "12/30/2018 4:25", "12/30/2018 4:40", "12/30/2018 4:55", "12/30/2018 5:10", "12/30/2018 5:25", "12/30/2018 5:40", "12/30/2018 5:55", "12/30/2018 6:10", "12/30/2018 6:25", "12/30/2018 6:40", "12/30/2018 6:55", "12/30/2018 7:10", "12/30/2018 7:25", "12/30/2018 7:40", "12/30/2018 7:55", "12/30/2018 8:10", "12/30/2018 8:25", "12/30/2018 8:40", "12/30/2018 8:55", "12/30/2018 9:10", "12/30/2018 9:25", "12/30/2018 9:40", "12/30/2018 9:55", "12/31/2018 0:10", "12/31/2018 0:25", "12/31/2018 0:40", "12/31/2018 0:55", "12/31/2018 1:10", "12/31/2018 1:25", "12/31/2018 1:40", "12/31/2018 1:55", "12/31/2018 10:10", "12/31/2018 10:25", "12/31/2018 10:40", "12/31/2018 10:55", "12/31/2018 11:10", "12/31/2018 11:25", "12/31/2018 11:40", "12/31/2018 11:55", "12/31/2018 12:10", "12/31/2018 12:25", "12/31/2018 12:40", "12/31/2018 12:55", "12/31/2018 13:10", "12/31/2018 13:25", "12/31/2018 13:40", "12/31/2018 13:55", "12/31/2018 14:10", "12/31/2018 14:25", "12/31/2018 14:40", "12/31/2018 14:55", "12/31/2018 15:10", "12/31/2018 15:25", "12/31/2018 15:40", "12/31/2018 15:55", "12/31/2018 16:10", "12/31/2018 16:25", "12/31/2018 16:40", "12/31/2018 16:55", "12/31/2018 17:10", "12/31/2018 17:25", "12/31/2018 17:40", "12/31/2018 17:55", "12/31/2018 18:10", "12/31/2018 18:25", "12/31/2018 18:40", "12/31/2018 18:55", "12/31/2018 19:10", "12/31/2018 19:25", "12/31/2018 19:40", "12/31/2018 19:55", "12/31/2018 2:10", "12/31/2018 2:25", "12/31/2018 2:40", "12/31/2018 2:55", "12/31/2018 20:10", "12/31/2018 20:25", "12/31/2018 20:40", "12/31/2018 20:55", "12/31/2018 21:10", "12/31/2018 21:25", "12/31/2018 21:40", "12/31/2018 21:55", "12/31/2018 22:10", "12/31/2018 22:25", "12/31/2018 22:40", "12/31/2018 22:55", "12/31/2018 23:10", "12/31/2018 23:25", "12/31/2018 23:40", "12/31/2018 23:55", "12/31/2018 3:10", "12/31/2018 3:25", "12/31/2018 3:40", "12/31/2018 3:55", "12/31/2018 4:10", "12/31/2018 4:25", "12/31/2018 4:40", "12/31/2018 4:55", "12/31/2018 5:10", "12/31/2018 5:25", "12/31/2018 5:40", "12/31/2018 5:55", "12/31/2018 6:10", "12/31/2018 6:25", "12/31/2018 6:40", "12/31/2018 6:55", "12/31/2018 7:10", "12/31/2018 7:25", "12/31/2018 7:40", "12/31/2018 7:55", "12/31/2018 8:10", "12/31/2018 8:25", "12/31/2018 8:40", "12/31/2018 8:55", "12/31/2018 9:10", "12/31/2018 9:25", "12/31/2018 9:40", "12/31/2018 9:55"), class = "Datetime"), Asset = structure(c(1L, 2L, 3L, 4L, 1L, 2L, 3L, 4L, 1L, 2L), .Label = c("AHU_01", "AHU_100", "AHU_101", "AHU_32"), class = "factor"), Sub_asset = c(NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), Supply = c(0,68.1499, 62.1832, 0, 0, 68.1085, 62.1173, 0, 0, 68.212), Return_water = c(64.3895, 69.3196, 53.1641, 59.2634, 64.1041,69.2989, 53.1172, 59.2415, 64.0602, 69.4024), supply_constant_check = structure(c(2L,2L, 2L, 1L, 2L, 2L, 2L, 1L, 2L, 2L), .Label = c("Constant","Not Constant"), class = "factor"), return_water_constant_check = structure(c(1L,1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = "Not Constant", class = "factor")), row.names = c(NA,10L), class = "data.frame") enter image description here我有一个下面的数据框,其中包含date_time列以及某些资产和Sub_asset标签。我需要在“供应”和“返回水”列下找到常量值。如果这些列下的值在6行中是常量,那么我想通过在其旁边插入新列来将其称为常量。另外,我想检查Supply和Return_water列下的常量,其中包含对资产和Sub_asset列变量进行分组的信息。请为我建议一个R代码。

enter image description here

1 个答案:

答案 0 :(得分:0)

您可以将apply plugin: 'com.android.application' apply plugin: 'io.fabric' repositories { … } sequence一起使用来计算有多少个重复值。使用rle

dplyr