Remove Constant Columns
Usage
remove_constant(x, ...)
# S4 method for class 'ANY'
remove_constant(x, na.rm = FALSE, verbose = getOption("arkhe.verbose"))Arguments
- x
An R object (should be a
matrixor adata.frame).- ...
Currently not used.
- na.rm
A
logicalscalar: shouldNAvalues be stripped before the computation proceeds?- verbose
A
logicalscalar: should R report extra information on progress?
See also
Other data cleaning tools:
clean_whitespace(),
remove_Inf(),
remove_NA(),
remove_empty(),
remove_zero(),
replace_Inf(),
replace_NA(),
replace_empty(),
replace_zero()
Examples
## Create a data.frame
X <- data.frame(A = 1, B = 1:3)
X
#> A B
#> 1 1 1
#> 2 1 2
#> 3 1 3
remove_constant(X)
#> B
#> 1 1
#> 2 2
#> 3 3
## Add NA
X[1, 1] <- NA
remove_constant(X)
#> A B
#> 1 NA 1
#> 2 1 2
#> 3 1 3
remove_constant(X, na.rm = TRUE)
#> B
#> 1 1
#> 2 2
#> 3 3
