Bug fixed: countscansmostuniquedevice stays the same for all time segments

pull/141/head
Weiyu 2021-06-03 11:49:30 -04:00 committed by JulioV
parent 56b344f9ce
commit 65d5cb7bd4
2 changed files with 6 additions and 2 deletions

View File

@ -1,8 +1,9 @@
library("dplyr", warn.conflicts = F) library("dplyr", warn.conflicts = F)
compute_wifi_feature <- function(data, feature, time_segment){ compute_wifi_feature <- function(data, feature, time_segment){
data <- data %>% filter_data_by_segment(time_segment)
if(feature %in% c("countscans", "uniquedevices")){ if(feature %in% c("countscans", "uniquedevices")){
data <- data %>% filter_data_by_segment(time_segment)
data <- data %>% group_by(local_segment) data <- data %>% group_by(local_segment)
data <- switch(feature, data <- switch(feature,
"countscans" = data %>% summarise(!!feature := n()), "countscans" = data %>% summarise(!!feature := n()),
@ -17,6 +18,7 @@ compute_wifi_feature <- function(data, feature, time_segment){
filter(N == max(N)) %>% filter(N == max(N)) %>%
head(1) %>% # if there are multiple device with the same amount of scans pick the first one only head(1) %>% # if there are multiple device with the same amount of scans pick the first one only
pull(bssid) pull(bssid)
data <- data %>% filter_data_by_segment(time_segment)
return(data %>% return(data %>%
filter(bssid == mostuniquedevice) %>% filter(bssid == mostuniquedevice) %>%
group_by(local_segment) %>% group_by(local_segment) %>%

View File

@ -1,8 +1,9 @@
library("dplyr", warn.conflicts = F) library("dplyr", warn.conflicts = F)
compute_wifi_feature <- function(data, feature, time_segment){ compute_wifi_feature <- function(data, feature, time_segment){
data <- data %>% filter_data_by_segment(time_segment)
if(feature %in% c("countscans", "uniquedevices")){ if(feature %in% c("countscans", "uniquedevices")){
data <- data %>% filter_data_by_segment(time_segment)
data <- data %>% group_by(local_segment) data <- data %>% group_by(local_segment)
data <- switch(feature, data <- switch(feature,
"countscans" = data %>% summarise(!!feature := n()), "countscans" = data %>% summarise(!!feature := n()),
@ -17,6 +18,7 @@ compute_wifi_feature <- function(data, feature, time_segment){
filter(N == max(N)) %>% filter(N == max(N)) %>%
head(1) %>% # if there are multiple device with the same amount of scans pick the first one only head(1) %>% # if there are multiple device with the same amount of scans pick the first one only
pull(bssid) pull(bssid)
data <- data %>% filter_data_by_segment(time_segment)
return(data %>% return(data %>%
filter(bssid == mostuniquedevice) %>% filter(bssid == mostuniquedevice) %>%
group_by(local_segment) %>% group_by(local_segment) %>%