signum: Sign classification

View source: R/Community.R

signumR 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))

SWotherspoon/QPress documentation built on Sept. 26, 2022, 2:27 a.m.