eeguana
eeguana copied to clipboard
drop_incomplete_segments() - new option to remove only if all channels are NA
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(.)))
Sure, that seems straightforward. But to be sure, the code that you posted works, right?
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.
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.
Sure, I'll be happy to give it a try after I'm done with moving.
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