which.max.all: [!] Get indices of minima/maxima

Description Usage Arguments Details Author(s) See Also Examples

View source: R/which.max.all.R

Description

Determines the location, i.e., index of all minimum or maximum values in a numeric or logical vector.

Usage

1
2
3
which.max.all(x, na.rm = FALSE, useNames = FALSE, ...)

which.min.all(x, na.rm = FALSE, useNames = FALSE, ...)

Arguments

x

numeric (logical, integer or double) vector or an R object for which the internal coercion to double works whose min or max is searched for.

na.rm

a logical indicating whether missing values should be removed.

useNames

logical indicating if the value of arrayInd() should have (non-null) dimnames at all.

...

Further parameters to be passed to which.

Details

Internaly functions which and as.vector are used.

Author(s)

Vilmantas Gegzna

See Also

Other matrix operations in spMisc: corr_vec2mat(), indMatrix(), nTri2nDiag(), revalueMatrix(), sort_matrix_elements, which.in(), which.max.perRow()

Examples

1
2
3
4
5
6
x <- c(1,2,1,3,3,2,1)
which.max.all(x)
#>  4 5

which.min.all(x)
#>  1 3 7

GegznaV/spMisc documentation built on April 26, 2020, 5:59 p.m.