Add start and end day segment to battery deltas

replace/0777259e5204cf16eabf62305b7c0bedb6bdc64b
JulioV 2019-11-21 12:39:52 -05:00
parent 34532a719b
commit d8421575ba
1 changed files with 4 additions and 2 deletions

View File

@ -16,7 +16,8 @@ if(nrow(battery) > 0){
local_end_date_time = last(local_date_time), local_end_date_time = last(local_date_time),
local_start_date = first(local_date), local_start_date = first(local_date),
local_end_date = last(local_date), local_end_date = last(local_date),
local_day_segment = first(local_day_segment)) %>% local_start_day_segment = first(local_day_segment),
local_end_day_segment = last(local_day_segment)) %>%
select(-group_id) %>% select(-group_id) %>%
filter(time_diff > 0.1) # Avoids including quick cycles filter(time_diff > 0.1) # Avoids including quick cycles
} else { } else {
@ -26,7 +27,8 @@ if(nrow(battery) > 0){
local_end_date_time = character(), local_end_date_time = character(),
local_start_date = character(), local_start_date = character(),
local_end_date = character(), local_end_date = character(),
local_day_segment = character()) local_start_day_segment = character(),
local_end_day_segment = character())
} }
write.csv(consumption, snakemake@output[[1]], row.names = FALSE) write.csv(consumption, snakemake@output[[1]], row.names = FALSE)