skip.cond: Skip vector/list elements that satisfy a condition

Description Usage Arguments Details Value Author(s) See Also Examples

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

Description

This function skips all vector or list elements that satisfy a given condition. 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
skip.cond(l, cond)

Arguments

l

an input vector or list

cond

a one-argument boolean-valued function

Details

The cond function is applied to all elements of l and those for which it returns TRUE are skipped. In particular, l can be a dataframe (a list of columns) and the function can be then used to skip columns that satisfy a condition.

Value

A copy of l with all elements for which the cond function returned TRUE skipped.

Author(s)

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

See Also

skip.val

Examples

1
2
3
4
5
skip.cond(1:10, function(e) e%%3==0)
skip.cond(as.list(1:10), function(e) e%%3==0)

data(weatherr, package="dmr.data")
skip.cond(weatherr, is.numeric)

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