which.2D: which.2D

Description Usage Arguments Value Author(s) Examples

Description

which.2D: Which cells are TRUE in a matrix-like object

which.min.2D: Which is the minimum cell in a matrix-like object

which.minN.2D: Which are the minimum N cells in a matrix-like object

which.max.2D: Which is the maximum cell in a matrix-like object

which.maxN.2D: Which are the maximum N cells in a matrix-like object

Usage

1
2
3
4
5
6
7
8
9
which.2D(x, add.names = FALSE)

which.min.2D(x, return.ties = FALSE)

which.minN.2D(x, N, return.ties = FALSE)

which.max.2D(x, return.ties = FALSE)

which.maxN.2D(x, N, return.ties = FALSE)

Arguments

x

a matrix or data.frame

add.names

logical: if TRUE, add x.name and y.name columns to the result

return.ties

logical: if there are ties in the top N, then return all values in the top N, or just N?

N

top 'N' values to return

Value

which.2D: a 2-column matrix of row and column indices, indicating the coordinates of the TRUE values in x

which.min.2D: a vector of length 2 indicating the x and y indices respectively

which.minN.2D: a matrix with 2 columns, col 1 for the rows and col 2 for the cols

which.max.2D: a vector of length 2 indicating the x and y indices respectively

which.maxN.2D: a matrix with 2 columns, col 1 for the rows and col 2 for the cols

Author(s)

Mark Cowley, 12/4/07

Mark Cowley, 2 Nov 2005

Mark Cowley, 2 Nov 2005

Mark Cowley, 2 Nov 2005

Mark Cowley, 2 Nov 2005

Examples

1
2
3
4
5
x <- matrix(rnorm(25), 5, 5)
which.2D(x>1)
#	  x y
# [1,] 1 4
# [2,] 4 3

drmjc/mjcbase documentation built on May 15, 2019, 2:27 p.m.