Get the Minimum and Maximum element of a Vector in R Programming - range() Function Last Updated : 16 Dec, 2021 Comments Improve Suggest changes Like Article Like Report 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 ExamplesExample 1: Get the Minimum and Maximum element of a Vector using range() Function in R language R # R program to find the # minimum and maximum element of a vector # Creating a vector x <- c(8, 2, 5, 4, 9, 6, 54, 18) # Calling range() function range(x) Output: [1] 2 54Example 2: Using range() Function in R programming with NA R # R program to find the # minimum and maximum element of a vector # Creating a vector x <- c(8, 2, Inf, 5, 4, NA, 9, 54, 18) # Calling range() function range(x) # Calling range() function # excluding NA values range(x, na.rm = TRUE) # Calling range() function # excluding finite values range(x, na.rm = TRUE, finite = TRUE) Output: [1] NA NA [1] 2 Inf [1] 2 54 Comment More infoAdvertise with us Next Article Get the Minimum and Maximum element of a Vector in R Programming - range() Function N nidhi_biet Follow Improve Article Tags : R Language R Vector-Function Similar Reads Get the Minimum element of an Object in R Programming - min() Function min() function in R Language is used to find the minimum element present in an object. This object can be a Vector, a list, a matrix, a data frame, etc.. Syntax: min(object, na.rm) Parameters: object: Vector, matrix, list, data frame, etc. na.rm: Boolean value to remove NA element. Example 1: Python 1 min read Get the Maximum element of an Object in R Programming - max() Function max() function in R Language is used to find the maximum element present in an object. This object can be a Vector, a list, a matrix, a data frame, etc.. Syntax: max(object, na.rm) Parameters: object: Vector, matrix, list, data frame, etc. na.rm: Boolean value to remove NA element. Example 1: Python 1 min read Get the position of the maximum element in each Row of a Matrix in R Programming - max.col() Function max.col() function in R Language check for maximum value in each row and returns the column no. for it. Syntax: max.col(x, ties.method) Parameters: x: Numeric matrix ties.method: It takes random, first, and last as value and returns the position accordingly in case of a tie. Example 1: Python3 1== # 1 min read Compute the Parallel Minima and Maxima between Vectors in R Programming - pmin() and pmax() Functions pmin() function in R Language is used to return the parallel minima of the input vectors. Syntax: pmin(x1, x2) Parameters: x1: vector one x2: vector two Example 1: Python3 1== # R program to illustrate # pmin() function # First example vector x1 <- c(2, 9, 5, 7, 1, 8) # Second example vector x2 1 min read Calculate Median of elements of a Vector in R Programming - median() Function median() function in R Language is used to calculate the median of the elements of the numeric vector passed as argument. Syntax: median(x, na.rm) Parameters: x: Numeric Vector na.rm: Boolean value to ignore NA Example 1: Python3 1== # R program to calculate median of a vector # Creating vector x1 1 min read Calculate the Cumulative Minima of a Vector in R Programming - cummin() Function cummin() function in R Language is used to calculate the cumulative minima of the values of vector passed as arguments. Syntax: cummin(x) Parameters: x: numeric object Example 1: Python3 1== # R program to cumulative minima # Calling cummin() function cummin(2:6) cummin(-2:-6) cummin(1.8:4.2) Output 1 min read Creating a Vector of sequenced elements in R Programming - seq() Function In This article, we will discuss how we Create a Vector of sequenced elements in R Programming Language using seq() Function. What are sequenced elements?Sequenced elements mean things that are placed in a particular order, one after another. This concept is often used in various fields. seq() Funct 2 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 Get a List of Numbers in the Specified Range in R Programming - seq.int() Function seq.int() function in R Language is used to return a list of numbers in the specified range. Syntax: seq.int(from, to, by) Parameters: from: specified range from to: specified range to by: specified number by which it jumps through returned number Example 1: Python3 # R program to illustrate # seq.i 1 min read Getting and Setting Length of the Vectors in R Programming - length() Function In R, the length() function is used to determine the number of elements in a vector. Vectors can be of various types, such as numeric, character, or logical, and the length() function provides a simple way to find out how many elements are contained in a vector. This function is versatile and can al 5 min read Like