eegUtils icon indicating copy to clipboard operation
eegUtils copied to clipboard

Epoching by arbitrary criteria

Open mattmoo opened this issue 1 year ago • 3 comments

Thanks for this great package, I'm very keen to never pick up Matlab again!

More of a feature request, but one thing that would leverage the strengths of R would be to get a bit more flexibility around selecting events for epochs, instead of just being a string match to the event types. Given that tibbles are used under the hood, maybe the filter() function?

mattmoo avatar Jan 07 '25 23:01 mattmoo

Could you a bit clearer on what kind of flexibility you had in mind? e.g. was it something like being able to use relational operators like > and < for numbers, rather than only ==?

craddm avatar Feb 04 '25 13:02 craddm

Yeah something like that, but even things like between(), %in%, %like%, as here. For my specific study, I have extra event columns stimulation_frequency (numeric) and perceptibility (factor), and being able to select a combination of those would be great!

mattmoo avatar Feb 07 '25 19:02 mattmoo

Ahh, I think what you need is already there - there are already wrappers around filter, mutate, rename, and select in the code (could probably make it clearer in the documentation... but see https://craddm.github.io/eegUtils/articles/eegUtils.html#tidyverse-functions)

It has been a while since I've tried them so I can't guarantee they'll handle everything correctly, but in principle they should, since they're just wrappers around the dplyr functions and should support everything they do.

craddm avatar Feb 07 '25 20:02 craddm