which.max.simple {spatial.tools} | R Documentation |
Locates the largest value of the input object.
which.max.simple(x, na.rm = TRUE, tie_value = "NA")
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). |
An integer of length 1 giving the index of the maximum of x or NA if the maximum of x is not unique, x has no non-NAs, or na.rm=F.
Jonathan A. Greenberg, Alison R. Mynsberge
## Not run: x<-c(2:4,1,1,NA) y<-c(4,1:3,NA,4) ## The index is only calculated for a unique maximum which.max.simple(x) which.max.simple(y) which.max.simple(y,na.rm=FALSE) which.max.simple(x,na.rm=FALSE) ## End(Not run)