Skip to contents

Which is larger

Usage

larger(x, y, compare_length = TRUE)

Arguments

x

num/obj

y

num/obj

compare_length

lgl whether the lengths rather than the values should be compared

Value

num the index of the larger, or 0 if equal

See also

Other conditionals: is_error(), is_legit(), is_project(), most(), same(), zchar()

Examples

larger(1,2)
#> [1] 0
larger(1,2, compare_length = FALSE)
#> [1] 2
larger(letters[1:3],letters[1:2])
#> [1] 1