Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Find Row and Column Number for Minimum and Maximum Values in an R Matrix



A matrix can have one or more than one minimum and maximum values. Also, the size of the matrix can be just one column and multiple rows or thousands of columns and thousands of rows. The row number and column number for the minimum and maximum values in a matrix can be found by using the following syntax −

For Maximum

which(“Matrix_Name”==min(“Matrix_Name”),arr.ind=TRUE)

For Minimum>

which(“Matrix_Name”==max(“Matrix_Name”),arr.ind=TRUE)

Example

 M1
Updated on: 2020-08-28T13:12:38+05:30

323 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements