Search notes:

R function: max

max(…) returns the maximum value of a vector.
The position of that element can be found with which.max(…).
max( c( 4, 9, 7, 12, 3, 6) )
# [1] 12

vector_with_NA <- c( NA, NA, 5, 6, 4, NA )

max( vector_with_NA, na.rm=TRUE  )
# [1] 6

max( vector_with_NA, na.rm=FALSE )
# [1] NA

#
# If the parameter na.rm is not specified, it defaults to false:
#
max( vector_with_NA )
# [1] NA
Github repository about-r, path: /functions/max.R

See also

min and range.
summary
Index to (some) R functions

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1745490469, '3.138.60.117', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/R/functions/max(65): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78