rray_mean()
computes the mean along a given axis or axes. The
dimensionality of x
is retained in the result.
rray_mean(x, axes = NULL)
x | A vector, matrix, or array to reduce. |
---|---|
axes | An integer vector specifying the axes to reduce over. |
The result of the reduction as a double with the same shape as x
, except
along axes
, which have been reduced to size 1.
#> <rray<dbl>[,1][1]> #> [,1] #> [1,] 5.5rray_mean(x, 1)#> <rray<dbl>[,2][1]> #> [,1] [,2] #> [1,] 3 8rray_mean(x, 2)#> <rray<dbl>[,1][5]> #> [,1] #> [1,] 3.5 #> [2,] 4.5 #> [3,] 5.5 #> [4,] 6.5 #> [5,] 7.5