filterLiColDeList: Filter lines(rows) and/or columns from all suitable elements...

View source: R/filterLiColDeList.R

filterLiColDeListR Documentation

Filter lines(rows) and/or columns from all suitable elements of list

Description

Filter all elements of list (or S3-object) according to criteria designed to one selected reference-element of the list. All simple vectors, matrix, data.frames and 3-dimensional arrays will be checked if matching number of rows and/or columns to decide if they should be filtered the same way. If the reference element has same number of rows and columns simple (1-dimensional) vectors won't be filtered since it not clear if this should be done to lines or columns.

Usage

filterLiColDeList(
  lst,
  useLines,
  useCols = NULL,
  ref = 1,
  silent = FALSE,
  callFrom = NULL,
  debug = FALSE
)

Arguments

lst

(list or S3 object) main input

useLines

(integer, logcial or character) vector to assign lines to keep when filtering along lines; set to NULL for no filtering; if 'allNA' all lines composed uniquely of NA values will be removed.

useCols

(integer, logcial or character) vector for filtering columns; set to NULL for no filtering; if 'allNA' all columns uniquely NA values will be removed

ref

(integer) index for designing the elment of 'lst' to take as reference for checking which other list-elements have suitable number of rows or columns

silent

(logical) suppress messages

callFrom

(character) allow easier tracking of messages produced

debug

(logical) additional messages for debugging

Details

This function is used eg in package wrProteo to simultaneaously filter raw and transformed data.

Value

This function returns the correct(ed) input (object of same class, of same length)

See Also

moderTest2grp for single comparisons, lmFit

Examples

lst1 <- list(m1=matrix(11:18,ncol=2), m2=matrix(21:30,ncol=2), indR=31:34,
  m3=matrix(c(21:23,NA,25:27,NA),ncol=2))
## here $m2 has more lines than $m1, and thus will be ignored when ref=1
filterLiColDeList(lst1, useLines=2:3)
filterLiColDeList(lst1, useLines="allNA", ref=4)


wrMisc documentation built on Sept. 11, 2024, 6:10 p.m.