diff --git a/docs/change-log.md b/docs/change-log.md index 1b3375dc..b460ee24 100644 --- a/docs/change-log.md +++ b/docs/change-log.md @@ -1,5 +1,7 @@ # Change Log - +## v1.2.1 (in progress) +- Fix PID matching when joining data from multiple participants. We can handle PIDS with an arbitrary format. +- Fix bug that did not correctly parse participants with more than 2 phones or more than 1 wearable ## v1.2.0 - Sleep summary and intraday features are more consistent. - Add wake and bedtime features for sleep summary data. diff --git a/src/features/utils/merge_sensor_features_for_all_participants.R b/src/features/utils/merge_sensor_features_for_all_participants.R index 972e56d3..38f5f101 100644 --- a/src/features/utils/merge_sensor_features_for_all_participants.R +++ b/src/features/utils/merge_sensor_features_for_all_participants.R @@ -10,7 +10,7 @@ feature_files <- snakemake@input[["feature_files"]] features_of_all_participants <- tibble(filename = feature_files) %>% # create a data frame mutate(file_contents = map(filename, ~ read.csv(., stringsAsFactors = F, colClasses = c(local_segment = "character", local_segment_label = "character", local_segment_start_datetime="character", local_segment_end_datetime="character"))), - pid = str_match(filename, ".*/([a-zA-Z]+?[0-9]+?)/.*")[,2]) %>% + pid = str_match(filename, ".*/(.*)/all_sensor_features.csv")[,2]) %>% unnest(cols = c(file_contents)) %>% select(-filename)