chs_mean: Get the by-sample (or by-row) mean of the specified channels.

View source: R/channel_functions.R

chs_meanR Documentation

Get the by-sample (or by-row) mean of the specified channels.

Description

Wrapper of rowMeans that performs a by-sample mean of the specified channels.

Usage

chs_mean(x, ..., na.rm = FALSE)

Arguments

x

An eeg_lst object.

...

A group of channels, it can be used in combination with across.

na.rm

a logical evaluating to TRUE or FALSE indicating whether NA values should be stripped before the computation proceeds.

Value

A new channel or an eeg_lst object with a mean channel instead of the previous channels.

See Also

Other channel functions: chs_fun()

Examples

## Not run: 
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)

## End(Not run)

bnicenboim/eeguana documentation built on March 16, 2024, 7:21 a.m.