rray_max_pos()
returns the integer position of the maximum value over an
axis.
rray_max_pos(x, axis = NULL)
x | A vector, matrix, array, or rray. |
---|---|
axis | A single integer specifying the axis to compute along. |
An integer object of the same type and shape as x
, except along axis
,
which has been reduced to size 1.
#> <rray<int>[,1,1][1]> #> , , 1 #> #> [,1] #> [1,] 11 #># Compute along the rows rray_max_pos(x, 1)#> <rray<int>[,2,2][1]> #> , , 1 #> #> [,1] [,2] #> [1,] 5 5 #> #> , , 2 #> #> [,1] [,2] #> [1,] 1 1 #># Compute along the columns rray_max_pos(x, 2)#> <rray<int>[,1,2][5]> #> , , 1 #> #> [,1] #> [1,] 2 #> [2,] 2 #> [3,] 2 #> [4,] 2 #> [5,] 2 #> #> , , 2 #> #> [,1] #> [1,] 1 #> [2,] 1 #> [3,] 1 #> [4,] 1 #> [5,] 1 #>