How to set to NAs some segments of a channel #182
-
See also #167 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Example: eeg_fake <- eeg_lst(signal_tbl = tibble(.id = rep(1:10, each =100), eeg_mutate(eeg_fake, P3 = case_when(.id %in% 1:5 ~ NA, |
Beta Was this translation helpful? Give feedback.
-
Thanks for this. The problem I'm having now is that when there are NAs in the signal table, various functions don't work. I believe it's because there's a check somewhere in datatable that is.double == TRUE, and the NAs violate this. So far I've noticed it affects eeg_artif_minmax() and bind(). And probably related functions like eeg_artif_step(). Here's the error message I get: As a reprex using your code above, I get a shorter version of the error (same problem though I think): eeg_fake <- eeg_lst(signal_tbl = tibble(.id = rep(1:10, each =100), eeg_fake <- eeg_mutate(eeg_fake, P3 = case_when(.id %in% 1:5 ~ NA, eeg_artif_minmax(eeg_fake, .threshold = 150, .window = 150, .unit = "ms", na.rm = TRUE) |
Beta Was this translation helpful? Give feedback.
Example:
eeg_fake <- eeg_lst(signal_tbl = tibble(.id = rep(1:10, each =100),
.sample = sample_int(rep(1:100, 10),500),
P1 = channel_dbl(rnorm(1000)),
P3 = channel_dbl(rnorm(1000))))
eeg_mutate(eeg_fake, P3 = case_when(.id %in% 1:5 ~ NA,
TRUE ~ P3))