MAX: Find maximum value

Description Usage Arguments Value Warning Author(s) See Also Examples

Description

Extension of standard max and min functions with which rank position(s) can be specified and result can be either rank or value.

Usage

1
MAX(vector, rank = 1, value = FALSE, rank.adjust = TRUE, forceChoice = FALSE)

Arguments

vector

Vector in which maximum/minimum element needs to be identified

rank

value(s) or rank(s) of maximum values.

value

Should value or rank be returned?

rank.adjust

If maximum value of range of ranks exceeds vector length, should this be adjusted?

forceChoice

In case of ties, should all results be returned or only one?

Value

numeric vector (either value or rank)

Warning

If minimum value (of a range of) rank(s) exceeds vector length, results are meaningless.

Author(s)

Sander Lestrade

See Also

MIN, NOUNS, SITUATION, SELECTVERB, SELECTACTOR, SELECTUNDERGOER, REFCHECK, TOPICCOPY, GENERALIZE, CHECKSUCCESS, ANALYZE, TYPEMATCH, NOUNMORPHOLOGY, VERBMORPHOLOGY, INTERPRET.INT, INTERPRET, NOUNDESEMANTICIZATION, VERBDESEMANTICIZATION, SEMUPDATE, DIE

Examples

1
2
3
a=rep(1:10, 2)
MAX(a, rank=1:3, value=TRUE, forceChoice=TRUE)
MIN(a, rank=1:3, value=TRUE, forceChoice=TRUE)

Example output

[1] 10 10  9
[1] 1 1 2

MoLE documentation built on May 2, 2019, 3:02 p.m.