which.min.simple: Location of Minimum Value

Description Usage Arguments Value Author(s) See Also Examples

Description

Locates the smallest value of the input object.

Usage

1
which.min.simple(x, na.rm = TRUE, tie_value = "NA")

Arguments

x

a numeric object

na.rm

a logical indicating whether missing values should be removed.

tie_value

A character indicating how to deal with ties. Can be "NA" (returns an NA if a tie is found) or "random" (returns a single randomly chosen member of the ties if a tie is found) or "first" (returns the first class found).

Value

An integer of length 1 giving the index of the minimum of x or NA if the minimum of x is not unique, x has no non-NAs, or na.rm=F.

Author(s)

Jonathan A. Greenberg, Alison R. Mynsberge

See Also

which.min, which, min

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 

x<-c(4,1:3,NA,4)
y<-c(2:4,1,1,NA)
## The index is only calculated for a unique minimum
which.min.simple(x)
which.min.simple(y)
which.min.simple(y,na.rm=FALSE)
which.min.simple(x,na.rm=FALSE)

## End(Not run)

azvoleff/spatial.tools documentation built on May 11, 2019, 5:18 p.m.