drop1val: Drop attributes (columns) that only take single values for a...

Description Usage Arguments Details Value Author(s) Examples

View source: R/r-utility-drop1val.R

Description

This function drops data columns that only take a single value for all rows. It is used in examples presented in the book Cichosz, P. (2015): Data Mining Algorithms: Explained Using R. See Appendix B or http://www.wiley.com/go/data_mining_algorithms for more details.

Usage

1
drop1val(cnames, data)

Arguments

cnames

a character vector of column names to use

data

a dataframe

Details

All columns with names not included in cnames or taking only a single unique value for all rows of data are dropped and the names of the remaining columns are returned.

Value

A vector of column names that appear in cnames and take at least 2 unique values in data.

Author(s)

Pawel Cichosz <p.cichosz@elka.pw.edu.pl>

Examples

1
2
3
4
data(weather, package="dmr.data")

drop1val(names(weather), weather[1:3,])
drop1val(names(weather), weather[4:6,])

42n4/dmr.util documentation built on May 20, 2019, 2:02 p.m.