We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pool_movement_data
Current function is
pool_movement_data <- function(date){ pattern_to_find <- paste0(date,".*_opt_flow.csv") # TODO: improve this so that is not recursive files <- list.files(pattern = pattern_to_find, recursive = TRUE, full.names = TRUE) names(files) <- files pooled_data <- purrr::map(files, function(tt) read_csv(tt, col_names = "total_flow") %>% # replace first element with zero mutate(total_flow = replace(total_flow, 1, 0)) ) %>% bind_rows(.id="source") if(nrow(pooled_data) > 0){ pooled_data <- pooled_data %>% # clean mutate(mac = str_extract(source, "[a-z|0-9]{2}:.*/"), mac = str_remove(mac, "/"), ) } return(pooled_data) }
The text was updated successfully, but these errors were encountered:
This was written when optic flow had only one value (the total_flow). The new way has more columns, so
flow_df <- purrr::map(flow_files, function(x) read_delim(x, delim=",", col_names = c("datetime", "movement", "x", "y"))) names(flow_df) <- basename(flow_files) flow_df <- flow_df %>% bind_rows(.id="filename") # clean flow_df <- flow_df %>% mutate(x = as.numeric(str_extract(x, "[0-9]+")), y = as.numeric(str_extract(y, "[0-9]+")))
Sorry, something went wrong.
No branches or pull requests
Current function is
The text was updated successfully, but these errors were encountered: