The max()
function in R is used to return the maximum value of a given vector.
max(...)
The max()
function takes ...
as a parameter value. This represents the vector objects from which the maximum value is to be determined.
The max()
function returns a numeric value with the maximum value in a vector object.
Let's look at the code below:
# creating vector objectsa <- c(1, 3, 2, 5, 6)b <- c(100, 4, 1)c <- c(99.9, 46, 3, 5)# obtaining the maximum value from the list of vector objectsmax(a, b, c)
a
, b
, and c
.max()
function to obtain the maximum value from the provided vectors. We then print it to the console.