From 86509207acc21bcd0b3d15adbf30fc73830ca72e Mon Sep 17 00:00:00 2001 From: JulioV Date: Fri, 23 Oct 2020 10:41:00 -0400 Subject: [PATCH] Turn off warnings for tidyverse and dplyr --- renv/activate.R | 4 +++- src/data/application_categories.R | 2 +- src/data/assign_to_day_segment.R | 2 +- src/data/download_fitbit_data.R | 2 +- src/data/download_phone_data.R | 2 +- src/data/join_visible_and_connected_wifi.R | 18 ------------------ src/data/phone_sensed_bins.R | 2 +- src/data/phone_sensed_timestamps.R | 2 +- src/data/phone_valid_sensed_days.R | 2 +- src/data/process_location_types.R | 2 +- src/data/unify_utils.R | 2 +- src/features/entry.R | 2 +- src/features/join_features_from_providers.R | 2 +- .../episodes/activity_recognition_episodes.R | 2 +- .../phone_battery/episodes/battery_episodes.R | 2 +- src/features/phone_bluetooth/rapids/main.R | 2 +- src/features/phone_locations/barnett/main.R | 2 +- .../phone_screen/episodes/screen_episodes.R | 2 +- .../phone_wifi_connected/rapids/main.R | 2 +- src/features/phone_wifi_visible/rapids/main.R | 2 +- src/features/utils/resample_episodes.R | 2 +- src/models/clean_features_for_model.R | 2 +- .../merge_features_for_individual_model.R | 4 ++-- .../merge_features_for_population_model.R | 2 +- 24 files changed, 26 insertions(+), 42 deletions(-) delete mode 100644 src/data/join_visible_and_connected_wifi.R diff --git a/renv/activate.R b/renv/activate.R index c2fe5e92..f71b9e85 100644 --- a/renv/activate.R +++ b/renv/activate.R @@ -1,6 +1,8 @@ local({ + options(tidyverse.quiet = TRUE) + # the requested version of renv version <- "0.10.0" @@ -302,7 +304,7 @@ local({ renv_bootstrap_validate_version(version) # load the project - renv::load(project) + renv::load(project, quiet = TRUE) TRUE diff --git a/src/data/application_categories.R b/src/data/application_categories.R index 08944fae..55d8f66b 100644 --- a/src/data/application_categories.R +++ b/src/data/application_categories.R @@ -1,7 +1,7 @@ source("renv/activate.R") library(tidyr) -library(dplyr) +library("dplyr", warn.conflicts = F) library(stringr) library("rvest") diff --git a/src/data/assign_to_day_segment.R b/src/data/assign_to_day_segment.R index ecf17973..26ffcdc1 100644 --- a/src/data/assign_to_day_segment.R +++ b/src/data/assign_to_day_segment.R @@ -1,5 +1,5 @@ library("tidyverse") -library("lubridate") +library("lubridate", warn.conflicts = F) options(scipen=999) day_type_delay <- function(day_type, include_past_periodic_segments){ diff --git a/src/data/download_fitbit_data.R b/src/data/download_fitbit_data.R index 19f01674..69dfc46d 100644 --- a/src/data/download_fitbit_data.R +++ b/src/data/download_fitbit_data.R @@ -1,6 +1,6 @@ source("renv/activate.R") library(RMySQL) -library(dplyr) +library("dplyr", warn.conflicts = F) library(readr) library(stringr) library(yaml) diff --git a/src/data/download_phone_data.R b/src/data/download_phone_data.R index d6c9dd10..29ee8d09 100644 --- a/src/data/download_phone_data.R +++ b/src/data/download_phone_data.R @@ -2,7 +2,7 @@ source("renv/activate.R") source("src/data/unify_utils.R") library(RMySQL) library(stringr) -library(dplyr) +library("dplyr", warn.conflicts = F) library(readr) library(yaml) library(lubridate) diff --git a/src/data/join_visible_and_connected_wifi.R b/src/data/join_visible_and_connected_wifi.R deleted file mode 100644 index 87c7a511..00000000 --- a/src/data/join_visible_and_connected_wifi.R +++ /dev/null @@ -1,18 +0,0 @@ -source("renv/activate.R") -library("dplyr") - -if(!is.null(snakemake@input[["visible_access_points"]]) && is.null(snakemake@input[["connected_access_points"]])){ - wifi_data <- read.csv(snakemake@input[["visible_access_points"]], stringsAsFactors = FALSE) - wifi_data <- wifi_data %>% mutate(connected = 0) -} else if(is.null(snakemake@input[["visible_access_points"]]) && !is.null(snakemake@input[["connected_access_points"]])){ - wifi_data <- read.csv(snakemake@input[["connected_access_points"]], stringsAsFactors = FALSE) - wifi_data <- wifi_data %>% mutate(connected = 1) -} else if(!is.null(snakemake@input[["visible_access_points"]]) && !is.null(snakemake@input[["connected_access_points"]])){ - visible_access_points <- read.csv(snakemake@input[["visible_access_points"]], stringsAsFactors = FALSE) - visible_access_points <- visible_access_points %>% mutate(connected = 0) - connected_access_points <- read.csv(snakemake@input[["connected_access_points"]], stringsAsFactors = FALSE) - connected_access_points <- connected_access_points %>% mutate(connected = 1) - wifi_data <- bind_rows(visible_access_points, connected_access_points) %>% arrange(timestamp) -} - -write.csv(wifi_data, snakemake@output[[1]], row.names = FALSE) \ No newline at end of file diff --git a/src/data/phone_sensed_bins.R b/src/data/phone_sensed_bins.R index 2d5664fa..0276a862 100644 --- a/src/data/phone_sensed_bins.R +++ b/src/data/phone_sensed_bins.R @@ -1,6 +1,6 @@ source("renv/activate.R") -library(dplyr) +library("dplyr", warn.conflicts = F) library(tidyr) all_sensors <- snakemake@input[["all_sensors"]] diff --git a/src/data/phone_sensed_timestamps.R b/src/data/phone_sensed_timestamps.R index 7d40a2ae..c8bb6495 100644 --- a/src/data/phone_sensed_timestamps.R +++ b/src/data/phone_sensed_timestamps.R @@ -1,5 +1,5 @@ source("renv/activate.R") -library(dplyr) +library("dplyr", warn.conflicts = F) library(readr) library(tidyr) library(purrr) diff --git a/src/data/phone_valid_sensed_days.R b/src/data/phone_valid_sensed_days.R index 649402dd..3df749dc 100644 --- a/src/data/phone_valid_sensed_days.R +++ b/src/data/phone_valid_sensed_days.R @@ -1,5 +1,5 @@ source("renv/activate.R") -library("dplyr") +library("dplyr", warn.conflicts = F) library("tidyr") phone_sensed_bins <- read.csv(snakemake@input[["phone_sensed_bins"]]) diff --git a/src/data/process_location_types.R b/src/data/process_location_types.R index a692d2cd..141ae417 100644 --- a/src/data/process_location_types.R +++ b/src/data/process_location_types.R @@ -1,5 +1,5 @@ source("renv/activate.R") -library(dplyr) +library("dplyr", warn.conflicts = F) library(readr) library(tidyr) diff --git a/src/data/unify_utils.R b/src/data/unify_utils.R index d82ed2ae..d78b0cb0 100644 --- a/src/data/unify_utils.R +++ b/src/data/unify_utils.R @@ -1,4 +1,4 @@ -library(dplyr) +library("dplyr", warn.conflicts = F) library(stringr) unify_ios_screen <- function(ios_screen){ diff --git a/src/features/entry.R b/src/features/entry.R index 0318ce45..c4220924 100644 --- a/src/features/entry.R +++ b/src/features/entry.R @@ -1,6 +1,6 @@ source("renv/activate.R") source("src/features/utils/utils.R") -library("dplyr") +library("dplyr",warn.conflicts = F) library("tidyr") sensor_data_files <- snakemake@input diff --git a/src/features/join_features_from_providers.R b/src/features/join_features_from_providers.R index 888a77e9..1b07a197 100644 --- a/src/features/join_features_from_providers.R +++ b/src/features/join_features_from_providers.R @@ -1,7 +1,7 @@ source("renv/activate.R") library("tidyr") -library("dplyr") +library("dplyr", warn.conflicts = F) location_features_files <- snakemake@input[["location_features"]] location_features <- setNames(data.frame(matrix(ncol = 1, nrow = 0)), c("local_segment")) diff --git a/src/features/phone_activity_recognition/episodes/activity_recognition_episodes.R b/src/features/phone_activity_recognition/episodes/activity_recognition_episodes.R index ee37785a..9a87b70f 100644 --- a/src/features/phone_activity_recognition/episodes/activity_recognition_episodes.R +++ b/src/features/phone_activity_recognition/episodes/activity_recognition_episodes.R @@ -1,5 +1,5 @@ source("renv/activate.R") -library("dplyr") +library("dplyr", warn.conflicts = F) activity_recognition <- read.csv(snakemake@input[[1]]) diff --git a/src/features/phone_battery/episodes/battery_episodes.R b/src/features/phone_battery/episodes/battery_episodes.R index 2dc01cdf..1b919b54 100644 --- a/src/features/phone_battery/episodes/battery_episodes.R +++ b/src/features/phone_battery/episodes/battery_episodes.R @@ -1,5 +1,5 @@ source("renv/activate.R") -library("dplyr") +library("dplyr", warn.conflicts = F) battery <- read.csv(snakemake@input[[1]]) diff --git a/src/features/phone_bluetooth/rapids/main.R b/src/features/phone_bluetooth/rapids/main.R index ae4b81dd..3389b7de 100644 --- a/src/features/phone_bluetooth/rapids/main.R +++ b/src/features/phone_bluetooth/rapids/main.R @@ -1,4 +1,4 @@ -library(dplyr) +library("dplyr", warn.conflicts = F) library(tidyr) compute_bluetooth_feature <- function(data, feature, day_segment){ diff --git a/src/features/phone_locations/barnett/main.R b/src/features/phone_locations/barnett/main.R index da013924..90f05b4e 100644 --- a/src/features/phone_locations/barnett/main.R +++ b/src/features/phone_locations/barnett/main.R @@ -1,5 +1,5 @@ source("renv/activate.R") -library("dplyr") +library("dplyr", warn.conflicts = F) library("stringr") # Load Ian Barnett's code. Taken from https://scholar.harvard.edu/ibarnett/software/gpsmobility diff --git a/src/features/phone_screen/episodes/screen_episodes.R b/src/features/phone_screen/episodes/screen_episodes.R index d5fabf52..3f254b14 100644 --- a/src/features/phone_screen/episodes/screen_episodes.R +++ b/src/features/phone_screen/episodes/screen_episodes.R @@ -1,6 +1,6 @@ source("renv/activate.R") -library(dplyr) +library("dplyr", warn.conflicts = F) library(tidyr) library(stringr) diff --git a/src/features/phone_wifi_connected/rapids/main.R b/src/features/phone_wifi_connected/rapids/main.R index 7c4ea072..eb2f1a9c 100644 --- a/src/features/phone_wifi_connected/rapids/main.R +++ b/src/features/phone_wifi_connected/rapids/main.R @@ -1,4 +1,4 @@ -library(dplyr) +library("dplyr", warn.conflicts = F) compute_wifi_feature <- function(data, feature, day_segment){ data <- data %>% filter_data_by_segment(day_segment) diff --git a/src/features/phone_wifi_visible/rapids/main.R b/src/features/phone_wifi_visible/rapids/main.R index 7c4ea072..eb2f1a9c 100644 --- a/src/features/phone_wifi_visible/rapids/main.R +++ b/src/features/phone_wifi_visible/rapids/main.R @@ -1,4 +1,4 @@ -library(dplyr) +library("dplyr", warn.conflicts = F) compute_wifi_feature <- function(data, feature, day_segment){ data <- data %>% filter_data_by_segment(day_segment) diff --git a/src/features/utils/resample_episodes.R b/src/features/utils/resample_episodes.R index a32fd97e..9db05b91 100644 --- a/src/features/utils/resample_episodes.R +++ b/src/features/utils/resample_episodes.R @@ -1,6 +1,6 @@ source("renv/activate.R") library("tibble") -library("dplyr") +library("dplyr", warn.conflicts = F) library("tidyr") library("tibble") options(scipen=999) diff --git a/src/models/clean_features_for_model.R b/src/models/clean_features_for_model.R index a11a86b8..7079c686 100644 --- a/src/models/clean_features_for_model.R +++ b/src/models/clean_features_for_model.R @@ -1,6 +1,6 @@ source("renv/activate.R") library(tidyr) -library(dplyr) +library("dplyr", warn.conflicts = F) filter_participant_without_enough_days <- function(clean_features, days_before_threshold, days_after_threshold){ clean_features$day_type <- ifelse(clean_features$day_idx < 0, -1, ifelse(clean_features$day_idx > 0, 1, 0)) diff --git a/src/models/merge_features_for_individual_model.R b/src/models/merge_features_for_individual_model.R index ea99055a..cb3a1f02 100644 --- a/src/models/merge_features_for_individual_model.R +++ b/src/models/merge_features_for_individual_model.R @@ -2,11 +2,11 @@ source("renv/activate.R") library(tidyr) library(purrr) -library(dplyr) +library("dplyr", warn.conflicts = F) library("methods") library("mgm") library("qgraph") -library("dplyr") +library("dplyr", warn.conflicts = F) library("scales") library("ggplot2") library("purrr") diff --git a/src/models/merge_features_for_population_model.R b/src/models/merge_features_for_population_model.R index abb36d6a..2808455b 100644 --- a/src/models/merge_features_for_population_model.R +++ b/src/models/merge_features_for_population_model.R @@ -2,7 +2,7 @@ source("renv/activate.R") library(tidyr) library(purrr) -library(dplyr) +library("dplyr", warn.conflicts = F) library(stringr) feature_files <- snakemake@input[["feature_files"]]