Skip to contents

This function filters out columns that are empty.

Usage

filter_empty_cols(
  data,
  id_cols = union(get_id_cols_abcd(), get_id_cols_hbcd())
)

Arguments

data

tibble. The data to be filtered.

id_cols

character (vector). The names of the ID columns to be excluded from the filtering (Default: identifier columns used in ABCD and HBCD).

Value

A tibble with the filtered data.

Examples

data <- tibble::tibble(
  participant_id = c("sub-001", "sub-002", "sub-003"),
  session_id = c("ses-001", "ses-001", "ses-002"),
  var1 = c(NA, NA, NA),
  var2 = c(NA, NA, 2),
  var3 = c(NA, NA, 3)
)
filter_empty_cols(data)
#> Error in check_pkgs(pkgs = list(NBDCtoolsData = list(remote = "nbdc-datahub/NBDCtoolsData")),     abort_msg = "NBDCtoolsData package is not installed", quiet = quiet): NBDCtoolsData package is not installed
#>  `NBDCtoolsData`
#>  Please install the missing packages with:
#> 
#> renv::install(c("nbdc-datahub/NBDCtoolsData"))