Skip to content

Commit

Permalink
Fix bug in process_location_types.R script (#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
jenniferfedor authored Aug 14, 2023
1 parent 4adeca8 commit 7cc543b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/change-log.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## v1.9.4

- Fix bug in process_location_types.R script that allowed for <1 minute time differences between a final resampled row and the next sensed location row
- Fix bug in PHONE_BATTERY RAPIDS provider that could result in negative values for battery consumption rate features
- Fix bug in PHONE_APPLICATIONS_FOREGROUND RAPIDS provider that could result in some rows being excluded from output depending on order in which apps are processed
- Fix bug in PHONE_SCREEN RAPIDS provider that dropped rows exceeding specified thresholds based on within-segment rather than overall episode duration
Expand Down
2 changes: 2 additions & 0 deletions src/data/process_location_types.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ if(locations_to_use == "ALL"){
id = id -1,
timestamp = timestamp + (id * 60000)) %>%
ungroup() %>%
# drop last resampled row from a group if there is not at least 1 minute between its timestamp and the following sensed location timestamp
filter(!(provider == "resampled" & !is.na(lead(timestamp)) & lead(timestamp) - timestamp < 60000)) %>%
select(-resample_group, -limit, -id)
} else {
processed_locations <- locations
Expand Down

0 comments on commit 7cc543b

Please sign in to comment.