Learn R Programming

contextual (version 0.9.8.4)

which_max_list: Get maximum value in list

Description

Returns the index of the maximum value in list x.

Usage

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

Run this code
# NOT RUN {
theta = list(par_one = list(1,2,3), par_two = list(2,3,4))
which_max_list(theta$par_one)

# }

Run the code above in your browser using DataLab