Learn R Programming

ribiosUtils (version 1.7.7)

removeInvarCol: Remove invariable columns from a data frame or matrix

Description

Columns with one unique value are invariable. The functions help to remove such columns from a data frame (or matrix) in order to highlight the variables.

Usage

removeInvarCol(df)

Value

isVarCol and isInvarCol return a logical vector indicating the variable and invariable columns respectively.

removeInvarCol removes invariable columns.

Arguments

df

A data frame or matrix

Author

Jitao David Zhang <jitao_david.zhang@roche.com>

Details

removeInvarCol the data frame removing invariable column(s).

isVarCol and isInvarCol are helper functions, returning a logical vector indicating the variable and invariable columns respectively.

Examples

Run this code

 testDf <- data.frame(a=1:4, b=7, c=LETTERS[1:4])
isVarCol(testDf)
isInvarCol(testDf)
removeInvarCol(testDf)

Run the code above in your browser using DataLab