Description Usage Arguments Details Value See Also Examples
Check if any elements in a row (column) of a matrix-like object is equal to a value.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | rowAnys(x, rows = NULL, cols = NULL, value = TRUE, na.rm = FALSE, ...)
## S4 method for signature 'matrix_OR_array_OR_table_OR_numeric'
rowAnys(x, rows = NULL,
cols = NULL, value = TRUE, na.rm = FALSE, dim. = dim(x), ...)
## S4 method for signature 'ANY'
rowAnys(x, rows = NULL, cols = NULL, value = TRUE, na.rm = FALSE, ...)
colAnys(x, rows = NULL, cols = NULL, value = TRUE, na.rm = FALSE, ...)
## S4 method for signature 'matrix_OR_array_OR_table_OR_numeric'
colAnys(x, rows = NULL,
cols = NULL, value = TRUE, na.rm = FALSE, dim. = dim(x), ...)
## S4 method for signature 'ANY'
colAnys(x, rows = NULL, cols = NULL, value = TRUE, na.rm = FALSE, ...)
|
x |
An NxK matrix-like object. |
rows, cols |
A |
value |
The value to search for. |
na.rm |
If |
... |
Additional arguments passed to specific methods. |
dim. |
An |
The S4 methods for x
of type matrix
,
array
, or numeric
call
matrixStats::rowAnys
/ matrixStats::colAnys
.
Returns a logical
vector
of length N (K).
matrixStats::rowAnys()
and
matrixStats::colAnys()
which are
used when the input is a matrix
or numeric
vector.
For checks if all elements are equal to a value, see
rowAlls()
.
base::any()
.
1 2 3 4 5 6 7 8 9 10 |
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,] -1.337052369 -1.42795660 -2.2235401
[2,] NA -2.67265921 -0.4614499
[3,] -0.469907029 -1.05063864 Inf
[4,] 0.000000000 1.04794540 0.7967357
[5,] 0.004185811 0.09336153 -0.7880032
[1] TRUE TRUE TRUE TRUE TRUE
[1] TRUE TRUE TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.