From 8909876cff7d52d49cc3cd41494b90bf8f0b8af2 Mon Sep 17 00:00:00 2001 From: Meng Li <34143965+Meng6@users.noreply.github.com> Date: Mon, 5 Apr 2021 21:13:36 +0000 Subject: [PATCH] Add local_segment column for phone data yield features --- src/features/phone_data_yield/rapids/main.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/phone_data_yield/rapids/main.R b/src/features/phone_data_yield/rapids/main.R index 50040d2d..080cfe1a 100644 --- a/src/features/phone_data_yield/rapids/main.R +++ b/src/features/phone_data_yield/rapids/main.R @@ -5,7 +5,7 @@ library(readr) compute_data_yield_features <- function(data, feature_name, time_segment, provider){ data <- data %>% filter_data_by_segment(time_segment) if(nrow(data) == 0) - return(tibble(ratiovalidyieldedminutes = numeric(), ratiovalidyieldedhours = numeric())) + return(tibble(local_segment = character(), ratiovalidyieldedminutes = numeric(), ratiovalidyieldedhours = numeric())) features <- data %>% separate(timestamps_segment, into = c("start_timestamp", "end_timestamp"), convert = T, sep = ",") %>% mutate(duration_minutes = (end_timestamp - start_timestamp) / 60000,