nonneg: Return Non-Negative Elements of a Numeric Vector

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

Description

Simply returns the non-negative elements of some input vector x. Defined as x[which(x >= 0)].

Usage

1
nonneg(x)

Arguments

x

Numeric vector.

Value

Numeric vector.

Author(s)

Dane R. Van Domelen

References

Acknowledgment: This material is based upon work supported by the National Science Foundation Graduate Research Fellowship under Grant No. DGE-0940903.

See Also

pos, neg, nonpos

Examples

1
2
3
4
5
6
# Generate 10 values from standard normal distribution
set.seed(123)
x <- rnorm(10)

# Find non-negative values
nonneg(x)

stocks documentation built on May 2, 2019, 5:22 p.m.