neg: Return Negative Elements of a Numeric Vector

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

View source: R/RcppExports.R

Description

Simply returns the negative (or non-positive) elements of some input vector x. Defined as x[which(x < 0)] or x[which(x <= 0)] depending on include.zero input.

Usage

1
neg(x, include.zero = FALSE)

Arguments

x

Numeric vector.

include.zero

If TRUE, elements <= 0 are returned; if FALSE, elements < 0 are returned.

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, nonpos, nonneg

Examples

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

# Find negative values
neg(x)

stocks documentation built on May 31, 2017, 3:18 a.m.

Search within the stocks package
Search all R packages, documentation and source code