Learn R Programming

argminCS (version 1.1.0)

find.sub.argmin: Get the index of the smallest dimension apart from an index

Description

Get the index of the smallest dimension apart from an index

Usage

find.sub.argmin(nums, idx, seed = NULL)

Value

The index of the second smallest dimension (as an integer).

Arguments

nums

A vector of numbers

idx

An index to be excluded

seed

(Optional) If provided, used to seed the random sampling (for reproducibility).

Examples

Run this code
nums <- c(1,3,2)
find.sub.argmin(nums,1)
## return 3

nums <- c(1,1,2)
find.sub.argmin(nums,1)
## return 2

Run the code above in your browser using DataLab