Learn R Programming

W4MRUtils (version 1.2.1)

generic_filter: Filtering a data set following the 3-tables format

Description

generic_filter This function allows to filter variables and samples according to factors or numerical values. It needs 3 datasets: the data matrix, the variables' metadata, the samples' metadata. It generates 3 new datasets corresponding to the 3 inputs filtered.

Usage

generic_filter(
  var.data,
  meta.samp.data,
  meta.var.data,
  NUM = FALSE,
  ls.num = NULL,
  FACT = FALSE,
  ls.fact = NULL
)

Value

a list containing the 3 tables, filtered according to the criteria input

Arguments

var.data

Data.frame corresponding to the dataMatrix of your 3-tables data set

meta.samp.data

Data.frame corresponding to the sampleMetadata of your 3-tables data set

meta.var.data

Data.frame corresponding to the variableMetadata of your 3-tables data set

NUM

Logical; indicates whether some filtering based on numeric metadata columns should be performed

ls.num

List of character vectors; each vector corresponds to a numerical filter to perform; see Details for vector content

FACT

Logical; indicates whether some filtering based on qualitative metadata columns should be performed

ls.fact

List of character vectors; each vector corresponds to a qualitative filter to perform; see Details for vector content

Author

M.Petera

Details

The vectors inside ls.num and ls.fact must follow a dedicated format. For ls.fact, each vector must be constituted of exactly 3 character strings in the following order: (i) the name of a column to filter in one of the metadata table, (ii) the modality inside this column to get rid off, and (iii) "sample" or "variable" depending on the type of metadata you are filtering (i.e. the table that contains the column to filter). For ls.num, each vector must be constituted of 4 to 5 character strings in the following order: (i) "sample" or "variable" depending on the type of metadata you are filtering (i.e. the table that contains the column to filter), (ii) the name of the column to filter in the corresponding metadata table, (iii) the type of numerical filtering to apply, to be chosen from "lower", "upper", "extremity" and "between", (iv) the threshold to be used for filtering (in case the 'iii' argument is "extremity" or "between", it is the lower threshold), and (v) in case the 'iii' argument is "extremity" or "between", the upper threshold.