Description Usage Arguments Details Value See Also Examples
Calculates the variance for each row (column) of a matrix-like object.
1 2 3 4 5 |
x |
An NxK matrix-like object. |
rows |
A |
cols |
A |
na.rm |
If |
The S4 methods for x
of type matrix
,
array
, or numeric
call
matrixStats::rowVars
/ matrixStats::colVars
.
Returns a numeric
vector
of length N (K).
matrixStats::rowVars()
and
matrixStats::colVars()
which are used
when the input is a matrix
or numeric
vector.
For mean estimates, see rowMeans2()
and
rowMeans()
.
For standard deviation estimates, see rowSds()
.
stats::var()
.
1 2 3 4 5 6 7 8 9 |
Loading required package: MatrixGenerics
Loading required package: matrixStats
Attaching package: ‘MatrixGenerics’
The following objects are masked from ‘package:matrixStats’:
colAlls, colAnyNAs, colAnys, colAvgsPerRowSet, colCollapse,
colCounts, colCummaxs, colCummins, colCumprods, colCumsums,
colDiffs, colIQRDiffs, colIQRs, colLogSumExps, colMadDiffs,
colMads, colMaxs, colMeans2, colMedians, colMins, colOrderStats,
colProds, colQuantiles, colRanges, colRanks, colSdDiffs, colSds,
colSums2, colTabulates, colVarDiffs, colVars, colWeightedMads,
colWeightedMeans, colWeightedMedians, colWeightedSds,
colWeightedVars, rowAlls, rowAnyNAs, rowAnys, rowAvgsPerColSet,
rowCollapse, rowCounts, rowCummaxs, rowCummins, rowCumprods,
rowCumsums, rowDiffs, rowIQRDiffs, rowIQRs, rowLogSumExps,
rowMadDiffs, rowMads, rowMaxs, rowMeans2, rowMedians, rowMins,
rowOrderStats, rowProds, rowQuantiles, rowRanges, rowRanks,
rowSdDiffs, rowSds, rowSums2, rowTabulates, rowVarDiffs, rowVars,
rowWeightedMads, rowWeightedMeans, rowWeightedMedians,
rowWeightedSds, rowWeightedVars
[,1] [,2] [,3]
[1,] -0.002654082 -1.4403892 1.3706918
[2,] NA 1.0348631 0.3255234
[3,] 1.336176343 1.4209654 Inf
[4,] 0.000000000 -1.8971467 -0.4056419
[5,] 1.222255357 0.8513312 -0.3000324
[1] 1.9758896 NA NaN 0.9980496 0.6300972
[1] NA 2.372138 NaN
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.