Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

negative

Apply method to Positive and Negative number


Description

Apply method to Positive and Negative number.

Usage

negative(x,method = "min")
positive(x,method = "min")
positive.negative(x,method = "min")

Arguments

x

A numerical vector with data.

method

Accept 3 values. "min", "max", "min.max".

Details

These functions apply the chosen method to the chosen subset (negative, positive, or both) from the vector and return the result.

Value

negative: apply the chosen method to every negative number of the input vector. positive: apply the chosen method to every positive number of the input vector. positive.negative: apply the chosen method to every negative and positive number of the input vector.

Author(s)

Manos Papadakis

R implementation and documentation: Manos Papadakis <papadakm95@gmail.com>.

See Also

Examples

x <- rnorm(1000)

identical(negative(x,"min"), min(x<0))
identical(positive(x,"min"), min(x>0))
identical(positive.negative(x,"min"), c(min(x<0),min(x>0)))

x<-NULL

Rfast

A Collection of Efficient and Extremely Fast R Functions

v2.0.1
GPL (>= 2.0)
Authors
Manos Papadakis, Michail Tsagris, Marios Dimitriadis, Stefanos Fafalios, Ioannis Tsamardinos, Matteo Fasiolo, Giorgos Borboudakis, John Burkardt, Changliang Zou, Kleanthi Lakiotaki and Christina Chatzipantsiou.
Initial release
2020-09-13

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.