From 5d68b5052c23beac7403cb085733a9790db6449f Mon Sep 17 00:00:00 2001 From: JulioV Date: Thu, 9 Apr 2020 12:07:35 -0400 Subject: [PATCH] Fix bug where no deltas where created for Android --- src/features/battery_deltas.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/battery_deltas.R b/src/features/battery_deltas.R index 508813f5..8aea316e 100644 --- a/src/features/battery_deltas.R +++ b/src/features/battery_deltas.R @@ -8,7 +8,7 @@ if(nrow(battery) > 0){ consumption <- battery %>% mutate(group = ifelse(lag(battery_status) != battery_status, 1, 0) %>% coalesce(0), group_id = cumsum(group) + 1) %>% - filter(battery_status == 2 || battery_status == 3) %>% + filter(battery_status == 2 | battery_status == 3) %>% group_by(group_id) %>% summarize(battery_diff = first(battery_level) - last(battery_level), time_diff = (last(timestamp) - first(timestamp)) / (1000 * 60 * 60),