Search notes:

R function: apply

#
#  Compare with lapply and rapply
#
m = matrix( c(   1,  19, 513,4173, 
                 8,  12, 281,6932,
                 7,  15, 801,7121),
             nrow=3,
             ncol=4)

m

apply(m, 1, max)            # 2nd parameter 1: per row
# [1] 4173 6932 7121

apply(m, 2, max)            # 2nd parameter 2: per column
# [1]  513 4173 6932 7121
Github repository about-r, path: /functions/apply.R

See also

Other apply functions
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...', 1758200925, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/R/functions/apply(56): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78