Return the Index of the First Minimum Value of a Numeric Vector in R Programming - which.min() Function Last Updated : 16 Jun, 2020 Comments Improve Suggest changes Like Article Like Report which.min() function in R Language is used to return the location of the first minimum value in the Numeric Vector. Syntax: which.min(x) Parameters: x: Numeric Vector Example 1: Python3 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)] Output: [1] 5 [1] 1 Example 2: Python3 1== # 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)] Output: [1] 8.3 10.3 19.0 16.0 15.6 19.8 [1] 1 [1] 8.3 Comment More infoAdvertise with us Next Article Return the Index of the First Minimum Value of a Numeric Vector in R Programming - which.min() Function N nidhi_biet Follow Improve Article Tags : R Language R Vector-Function Similar Reads Return the Index of the First Maximum Value of a Numeric Vector in R Programming - which.max() Function which.max() function in R Language is used to return the location of the first maximum value in the Numeric Vector. Syntax: which.max(x) Parameters: x: Numeric Vector Example 1: Python3 1== # R program to find index of # first maximum value # Creating a vector x <- c(2, 3, 4, 5, 1, 2, 3, 1, 2) # 1 min read Return True Indices of a Logical Object in R Programming - which() Function which() function in R Language is used to return the indices of the object which return true for the logical operation passed as argument. Syntax: which(x, arr.ind) Parameters: x: logical object arr.ind: Boolean value to display indices Example 1: Python3 1== # R program to illustrate # the use of w 1 min read Get the Minimum and Maximum element of a Vector in R Programming - range() Function range() function in R Programming Language is used to get the minimum and maximum values of the vector passed to it as an argument. Syntax: range(x, na.rm, finite) Parameters: x: Numeric Vectorna.rm: Boolean value to remove NAfinite: Boolean value to exclude non-finite elementsR - range() Function 1 min read Calculate Rank of the Values of a Vector in R Programming - rank() Function rank() function in R Language is used to return the sample ranks of the values of a vector. Equal values and missing values are handled in multiple ways. Syntax: rank(x, na.last) Parameters: x: numeric, complex, character, and logical vector na.last: Boolean Value to remove NAs Example 1: Python3 1= 1 min read Search the Interval for Minimum and Maximum of the Function in R Programming - optimize() Function optimize() or optimise() function in R Language is used to search the interval from lower to upper for a minimum or maximum of the function f with respect to its first argument. Syntax: optimize(f, interval, maximum)Parameters: f: the function to be optimized. The function is either minimized or ma 2 min read Like