rc_strip: Remove empty rows and columns from a REDCap dataframe

View source: R/rc_strip.R

rc_stripR Documentation

Remove empty rows and columns from a REDCap dataframe

Description

Removes any columns which contain only NA. Likewise, rows are removed in a similar fashion but any REDCap factor fields (record_id, redcap event/repeat) are ignored.

Usage

rc_strip(
  record_data,
  columns = TRUE,
  rows = TRUE,
  factor_cols = NULL,
  id_field = getOption("redcap_bundle")$id_field
)

Arguments

record_data

Dataframe. Record data exported from REDCap

columns

Logical. When TRUE, empty columns will be removed.

rows

Logical. When TRUE, empty rows will be removed.

factor_cols

Character. Column names to ignore when looking for empty rows. By default, the id_field and the REDCap event/repeat columns will be used.

id_field

Character. The name of the record_id field for your REDCap project.

Author(s)

Marcus Lehr


chillywings/rctools documentation built on Aug. 9, 2024, 11:52 p.m.