whichN: whichN

Description Usage Arguments Value Author(s)

Description

which.minN: Get the indices of the N smallest values in x

minN: Get the N smallest values from x

which.maxN: Get the indices of the N largest values in x

maxN: Get the N largest values from x

Usage

1
2
3
4
5
6
7
which.minN(x, N = 5, return.ties = FALSE)

minN(x, N = 5, sort = TRUE, return.ties = FALSE)

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

maxN(x, N = 5, sort = TRUE, return.ties = FALSE)

Arguments

x

a vector of numbers

N

how many values are to be returned

return.ties

logical: if there are multiple Nth smallest values, return all the indices?

sort

if FALSE: return the N values in order of appearance; else return the N values in increasing order.

Value

which.minN: the indices of the N smallest values in x. possibly more than N if return.ties=TRUE and the Nth smallest value appears more than once.

minN: return the N smallest values from x (possibly sorted), possibly more than N if return.ties=TRUE and the Nth smallest value appears more than once.

which.maxN: return the indices of the N largest values in x. possibly more than N if return.ties=TRUE and the Nth largest value appears more than once.

maxN: return the N largest values from x (possibly sorted), possibly more than N if return.ties=TRUE and the Nth largest value appears more than once.

Author(s)

Mark Cowley, 24 May 2005


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