signum {QPress}R Documentation

Sign classification

Description

Classify the sign of the elements of a vector

Usage

signum(x, epsilon = 1e-05)

Arguments

x

vector of values to test

epsilon

magnitude threshold

Details

Calculates the sign of the elements of then vector x, except that values less than epsilon in magnitude are rounded down to zero.

Value

Returns a vector with elements +1,0 or -1.

Examples

signum(c(-40,-3,-0.1E-8,0,2,5))

[Package QPress version 0.21 Index]