xxxxxxxxxx
max(mtcars[5,]) # Compute max of one row
# 360
xxxxxxxxxx
sapply(mtcars, max) # Compute max of all columns
# mpg cyl disp hp drat wt qsec vs am gear carb
# 33.900 8.000 472.000 335.000 4.930 5.424 22.900 1.000 1.000 5.000 8.000
xxxxxxxxxx
sapply(mtcars, min) # Compute min of all columns
# mpg cyl disp hp drat wt qsec vs am gear carb
# 10.400 4.000 71.100 52.000 2.760 1.513 14.500 0.000 0.000 3.000 1.000
xxxxxxxxxx
max(c(mtcars$mpg, mtcars$cyl)) # Max between two columns / vectors
# 33.9
xxxxxxxxxx
min(c(mtcars$mpg, mtcars$cyl)) # Min between two columns / vectors
# 4