Skip to content
New issue

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

Read aggregated Embrace Plus and Nowatch data #20

Merged
merged 19 commits into from
Apr 25, 2024
Merged

Conversation

hypebright
Copy link
Collaborator

@hypebright hypebright commented Mar 28, 2024

@PCdLf some initial functionality to work with aggregated Embrace Plus data, and aggregated Nowatch data.

As discussed, this is still using zip files, but we can change that easily in a next PR.

For testing (I have wearables in the same folder as wearalyze, make sure paths are correct):

devtools::load_all()

# for zipfiles
nowatch_zipfile <- "../wearalyze/app/static/example_data/nowatch_large.zip"
nowatch_data <- wearables::read_nowatch(zipifle = nowatch_zipfile)
aggregate_nowatch_data <- wearables::aggregate_nowatch_data(nowatch_data)

embrace_plus_zipfile <- "../wearalyze/app/static/example_data/embrace-plus-agg_large.zip"
embrace_plus_data <- wearables::read_embrace_plus(zipfile = embrace_plus_zipfile, type = "aggregated")
aggregate_embrace_plus_data <- wearables::aggregate_embrace_plus_data(embrace_plus_data, "5 min")

e4_zipfile <- "../wearalyze/app/static/example_data/e4_large.zip"
e4_data <- wearables::read_e4(zipfile = e4_zipfile)
aggregate_e4_data <- wearables::aggregate_e4_data(e4_data)

# for folders
nowatch_folder <- "../wearalyze/app/static/example_data/nowatch_large"
nowatch_data <- wearables::read_nowatch(folder = nowatch_folder)
aggregate_nowatch_data <- wearables::aggregate_nowatch_data(nowatch_data)

embrace_plus_folder <- "../wearalyze/app/static/example_data/embrace-plus-agg_large"
embrace_plus_data <- wearables::read_embrace_plus(folder = embrace_plus_folder, type = "aggregated")
aggregate_embrace_plus_data <- wearables::aggregate_embrace_plus_data(embrace_plus_data, "5 min")



@hypebright hypebright requested a review from PCdLf March 28, 2024 15:33
Comment on lines +26 to +30
# omitting NAs: TBD
# the Embrace Plus aggregated files have a lot of NAs,
# for example when the device wasn't able to record anything
# we need to decide how to handle these NAs
eda_filt <- process_eda(na.omit(data$EDA))
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you know I'm no expert when it comes to analysing this data, but thebutter_lowpass_filter doesn't work the same as it does with other devices when there are a lot of NAs. The aggregated Embrace Plus data also has "data" present when the device wasn't worn. When I removed the NAs the flow seemed to work fine again, but would be good to double check what the implications are

@PCdLf PCdLf merged commit 434e056 into master Apr 25, 2024
1 check passed
@hypebright hypebright deleted the embrace-plus-aggregated branch May 2, 2024 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants