Add local_day_segment to battery deltas

replace/3842090a614716c22455eab4e2fe450d969bc372
JulioV 2019-11-21 11:34:30 -05:00
parent f7be15ea9e
commit 30f814887d
1 changed files with 4 additions and 2 deletions

View File

@ -15,7 +15,8 @@ if(nrow(battery) > 0){
local_start_date_time = first(local_date_time), local_start_date_time = first(local_date_time),
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)) %>%
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 {
@ -24,7 +25,8 @@ if(nrow(battery) > 0){
local_start_date_time = character(), local_start_date_time = character(),
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())
} }
write.csv(consumption, snakemake@output[[1]], row.names = FALSE) write.csv(consumption, snakemake@output[[1]], row.names = FALSE)