Find the maximum and minimum value of every column and then find the maximum and minimum value of every row

前端 未结 4 774
离开以前
离开以前 2020-12-13 19:04

I\'ve got this matrix:

a <- matrix(rnorm(1000 * 18, mean = 100, sd = sqrt(10)), 1000, 18)

I would like to find the maximum and minimum v

4条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-13 19:12

    See the matrixStats package. You can use colMins(), rowMaxs() and functions like this both for columns and rows.

    See this answer: How to find the highest value of a column in a data frame in R?

提交回复
热议问题