function in R Language is used to return the location of the first minimum value in the Numeric Vector.**which.min()**

Syntax:which.min(x)

Parameters:

x:Numeric Vector

**Example 1:**

`# R program to find index of ` `# first minimum value ` ` ` `# Creating a vector ` `x <` `-` `c(` `2` `, ` `3` `, ` `4` `, ` `5` `, ` `1` `, ` `2` `, ` `3` `, ` `1` `, ` `2` `) ` ` ` `# Calling which.min() function ` `which.` `min` `(x) ` ` ` `# Printing minimum value ` `x[which.` `min` `(x)] ` |

*chevron_right*

*filter_none*

**Output:**

[1] 5 [1] 1

**Example 2:**

`# R program to find index of ` `# first minimum value ` ` ` `# Calling pre-defined dataset ` `BOD$demand ` ` ` `# Calling which.min() function ` `which.` `min` `(BOD$demand) ` ` ` `# Printing minimum value ` `BOD$demand[which.` `min` `(BOD$demand)] ` |

*chevron_right*

*filter_none*

**Output:**

[1] 8.3 10.3 19.0 16.0 15.6 19.8 [1] 1 [1] 8.3

## Recommended Posts:

- Return the Index of the First Maximum Value of a Numeric Vector in R Programming - which.max() Function
- Compute the gamma value of a Non-negative Numeric Vector in R Programming - gamma() Function
- Check if an Object is of Type Numeric in R Programming - is.numeric() Function
- Convert Factor to Numeric and Numeric to Factor in R Programming
- Return a Logical Vector with Missing Values removed in R Programming - complete.cases() Function
- Binning a Numeric Vector in R Programming - .bincode() Function
- Adding Noise to a Numeric Vector in R Programming - jitter() Function
- Get the Sign of Elements of a Numeric Vector in R Programming - sign() Function
- Convert an Object into a Vector in R Programming - as.vector() Function
- Check for the Existence of a Vector Object in R Programming - is.vector() Function
- Create a Vector of Colors from a Vector of Gray Levels in R Programming - gray() or grey() Function
- Check if a numeric value falls between a range in R Programming - between() function
- Compute the beta value of Non-Negative Numeric Vectors in R Programming - beta() Function
- Count the Frequency of elements in a Numeric Vector - tabulate() Function
- Create a Vector of Colors with specified Hue, Saturation and Value in R Programming - hsv() Function
- Return a Matrix with Lower Triangle as TRUE values in R Programming - lower.tri() Function
- Return True Indices of a Logical Object in R Programming - which() Function
- Return an Object with the specified name in R Programming - get0() and mget() Function
- Search and Return an Object with the specified name in R Programming - get() Function
- Return a Matrix with Upper Triangle as TRUE values in R Programming - upper.tri() Function

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.