is_matrix | R Documentation |
is_matrix
verifies that mx
is a
valid 2x2 matrix (i.e., a numeric contingency table).
is_matrix(mx)
mx |
An object to verify (required). |
is_matrix
is more restrictive than is.matrix
,
as it also requires that mx
is.numeric
,
is.table
, nrows(mx) == 2
, and ncols(mx) == 2
.
A Boolean value: TRUE
if mx
is a numeric matrix and 2x2 contingency table;
otherwise FALSE
.
Neth, H., Gradwohl, N., Streeb, D., Keim, D.A., & Gaissmaier, W. (2021). Perspectives on the 2×2 matrix: Solving semantically distinct problems based on a shared structure of binary contingencies. Frontiers in Psychology, 11, 567817. doi: doi: 10.3389/fpsyg.2020.567817
Other verification functions:
is_complement()
,
is_extreme_prob_set()
,
is_freq()
,
is_integer()
,
is_perc()
,
is_prob()
,
is_suff_prob_set()
,
is_valid_prob_pair()
,
is_valid_prob_set()
,
is_valid_prob_triple()
is_matrix(1:4) is_matrix(matrix("A")) is_matrix(matrix(1:4)) is_matrix(as.table(matrix(1:4, nrow = 1, ncol = 4))) is_matrix(as.table(matrix(1:4, nrow = 4, ncol = 1))) is_matrix(as.table(matrix(1:4, nrow = 2, ncol = 2)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.