VOOZH about

URL: https://www.geeksforgeeks.org/r-language/get-the-maximum-element-of-an-object-in-r-programming-max-function/

⇱ Get the Maximum element of an Object in R Programming - max() Function - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Get the Maximum element of an Object in R Programming - max() Function

Last Updated : 15 Jul, 2025
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: Output:
[1] 9
[1] NA
[1] 11
Example 2: Output:
,, 1

 [, 1] [, 2] [, 3]
[1, ] 2 4 6
[2, ] 3 5 7,, 2

 [, 1] [, 2] [, 3]
[1, ] 8 10 12
[2, ] 9 11 13

[1] 13
Comment

Explore