Learn R Programming

ribiosUtils (version 1.5-6)

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)

Arguments

df

A data frame or matrix

Value

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

removeInvarCol removes invariable columns.

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
# NOT RUN {
 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