Learn R Programming

NBDCtools (version 1.0.2)

filter_empty_rows: Filter empty rows

Description

This function filters out rows that are empty

Usage

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

Value

A tibble with the filtered data.

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).

Examples

Run this code
if (FALSE) { # requireNamespace("NBDCtoolsData", quietly = TRUE)
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, 1),
  var2 = c(NA, NA, 2),
  var3 = c(NA, NA, 3)
)
filter_empty_rows(data)
}

Run the code above in your browser using DataLab