Skip to contents

Given a matrix, it returns a dataframe with two column: - first column are min values for each row of the original matrix - second column are indices of min values

Usage

rowMin(mat)

Arguments

mat

Matrix object

Value

A dataframe with values and indices of min for each row

Examples

mat <- matrix(1:9, nrow = 3)
mat
#>      [,1] [,2] [,3]
#> [1,]    1    4    7
#> [2,]    2    5    8
#> [3,]    3    6    9

rowMin(mat)
#>   value index
#> 1     1     1
#> 2     2     1
#> 3     3     1