Closed spressi closed 12 months ago
Could you share some data to reproduce the example?
Sorry, now I cannot reproduce it myself anymore. Seems like I should have checked more thoroughly before posting, my bad. I'll try again within the next few days and will reopen the issue if I can reproduce the problem.
I need to perform an artifact detection on a subset of the trials of my EEG data (I want to save computation time because I plan to run a multiverse analysis). I cannot segment only for the relevant part of the data because I need the segment .id to align with the trial number (I have 432 trials per subject, only need to analyse 288 per subject, but the position of these 288 trials is randomized).
I used something like this to achieve my goal:
Unexpectedly,
eeg.artifacts
has entries in the .signal andevents_tbl
that should not be present according to theeeg_filter
. More specifically,eeg.artifacts$.signal$.id %>% max()
turns out to be 432 even though its predecessoreeg.segmented %>% eeg_filter(.id %in% trials.analyse) %>% events_tbl() %>% pull(.id) %>% max()
is 431 (same if I check the .id of the .signal table aftereeg_filter
). Could it be that theeeg_artif_minmax
(and probably other artifact detection functions) do not use the .id of the current segment but count upwards or expect that all ids are present or something like that?Reprex
Operative system:
(Windows 10, Ubuntu 20.04.2 LTS, etc)
Output of
sessionInfo()
: