ustep: Calculate the unit step function value

Description Usage Arguments Details Value Author(s) Examples

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

Description

This function calculates the unit step values by comparing input argument against a threshold. 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
ustep(v, thres = 0)

Arguments

v

a numeric vector

thres

a numeric threshold

Details

The unit step value is 1 if the input argument is greater than or equal to the threshold and 0 otherwise.

Value

A vector of unit step values for all input argument values from v.

Author(s)

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

Examples

1
2
ustep(seq(-1,1,0.25))
ustep(seq(-1,1,0.25), 0.5)

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