Learn R Programming

scmamp (version 0.2.3)

filterData: Expression based row filtering

Description

This is a simple function to filter data based on an expression defined using the colum names

Usage

filterData(data, condition = "TRUE", remove.cols = NULL)

Arguments

data
A NAMED matrix or data frame to be filtered (column names are required).
condition
A string indicating the condition that the row have to fulfill to be retained. The column names are used as variables in the condition (see examples bellow).
remove.cols
Either a vector of column names or a vector of column indices to be removed from the result

Value

  • The original data where the rows for which the condition is FALSE and the columns in the vector remove.cols have been removed

See Also

summarizeData, writeTabular and the vignette vignette(topic="Data_loading_and_manipulation", package="scmamp")

Examples

Run this code
data(data_gh_2008)
names(data.gh.2008)
filterData(data.gh.2008, condition="CN2 > 0.7 & Kernel < 0.7", remove.cols=1:2)

Run the code above in your browser using DataLab