,
R/channel_functions.R
chs_mean.Rd
Wrapper of rowMeans
that performs a by-sample mean of the specified channels.
chs_mean(x, ..., na.rm = FALSE)
An eeg_lst
object.
A group of channels, it can be used in combination with across
.
a logical evaluating to TRUE
or FALSE
indicating whether NA
values should be stripped before the
computation proceeds.
A new channel or an eeg_lst
object with a mean
channel instead of the previous channels.
Other channel functions:
chs_fun()
if (FALSE) {
faces_segs_some %>%
eeg_transmute(
Occipital = chs_mean(O1, O2, Oz, na.rm = TRUE),
Parietal = chs_mean(P3, P4, P7, P8, Pz, na.rm = TRUE)
)
faces_segs_some %>%
eeg_transmute(
Occipital = chs_mean(O1, O2, Oz, na.rm = TRUE),
Parietal = chs_mean(P3, P4, P7, P8, Pz, na.rm = TRUE)
)
faces_seg %>%
eeg_transmute(
Occipital = chs_mean(across(starts_with("O")), na.rm = TRUE), # O1, O2, Oz
Parietal = chs_mean(across(starts_with("O")), na.rm = TRUE) # P3, P4, P7, P8, Pz
)
faces_segs_some %>%
chs_mean(na.rm = TRUE)
}