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

drop_incomplete_segments() - new option to remove only if all channels are NA #164

Open
themeo opened this issue Apr 7, 2021 · 5 comments

Comments

@themeo
Copy link

themeo commented Apr 7, 2021

At present drop_incomplete_segments() drops the segment if any channel is NA. It would be useful to have a parameter to remove segments only if all channels are NA.

so the logic would be the following:

x %>% dplyr::group_by(.id) %>%
  dplyr::filter_at(channel_names(.),
                   dplyr::any_vars(!is.na(.)))
@bnicenboim
Copy link
Owner

Sure, that seems straightforward.
But to be sure, the code that you posted works, right?

@themeo
Copy link
Author

themeo commented Apr 7, 2021

Yes it does. :) It is based on your code, just changed all-not-NA to any-not-NA and got rid of all() function in the middle because in this case it was not necessary.

@bnicenboim
Copy link
Owner

ok, then feel free to make a pull request to the experimental branch ;)
I guess there could be a parameter all set to TRUE by default.

Do you want to give it a try?

also I'm slowly making my internal functions to be based on data table, to speed up things, if you want to code it in data table, you're more than welcome.

@themeo
Copy link
Author

themeo commented Apr 10, 2021

Sure, I'll be happy to give it a try after I'm done with moving.

@bnicenboim
Copy link
Owner

Not sure if you're still using the package. If so, is this still relevant?
I think using this function solves the issue: https://bruno.nicenboim.me/eeguana/reference/eeg_events_to_NA.html

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

No branches or pull requests

2 participants