filterDataSingle: Filter data for a single filter

View source: R/dataManipulation-filterData.R

filterDataSingleR Documentation

Filter data for a single filter

Description

Filter data for a single filter

Usage

filterDataSingle(
  data,
  filters,
  keepNA = TRUE,
  returnAll = FALSE,
  labelVars = NULL,
  labelData = "data"
)

Arguments

data

Data.frame with data.

filters

Unique filter or list of filters.

keepNA

Logical, if TRUE (by default) missing values in var are retained. If set to FALSE, missing values are ignored for all filters. The specification within filters prevails on this parameter.

returnAll

Logical:

  • if FALSE (by default): the data for only the filtered records is returned.

  • if TRUE: the full data is returned. Records are flagged based on the filters condition, in a new column: varNew (if specified), or 'keep' otherwise; containing TRUE if the record fulfill all conditions, FALSE otherwise

labelVars

Named character vector containing variable labels.

labelData

(optional) String with label for input data, that will be included in progress messages.

Value

Updated data with attributes:

  • 'labelVars': input labelVars with any new variables if labelNew is specified.

  • 'msg': message describing the filtering process

  • 'warn': warning describing the filtering process

Author(s)

Laure Cougnaud


clinDataReview documentation built on March 7, 2023, 5:13 p.m.