which_max_list: Get maximum value in list

Description Usage Arguments Details Examples

View source: R/functions_utility.R

Description

Returns the index of the maximum value in list x.

Usage

1
which_max_list(x, equal_is_random = TRUE)

Arguments

x

vector of values

equal_is_random

boolean

Details

If there is a tie and equal_is_random is TRUE, the index of one of the tied maxima is returned at random.

If equal_is_random is FALSE, the maximum with the lowest index number is returned.

Examples

1
2
theta = list(par_one = list(1,2,3), par_two = list(2,3,4))
which_max_list(theta$par_one)

Nth-iteration-labs/contextual documentation built on July 28, 2020, 1:13 p.m.