Description Usage Arguments See Also Examples
Test if an object is a square numeric matrix (or not) (i.e. same number of rows as number of columns)
1 |
x |
an R object |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # numeric matrices
m1 = matrix(1:9, 3, 3)
m2 = matrix(1:12, 4, 3)
is_square_numeric_matrix(m1) # TRUE
is_square_numeric_matrix(m2) # FALSE
is_not_square_numeric_matrix(m2) # TRUE
# non-numeric matrices
str_mat = matrix(letters[1:9], 3, 3)
log_mat = matrix(rep_len(c(TRUE, FALSE), 9), 3, 3)
is_square_numeric_matrix(str_mat) # FALSE
is_square_numeric_matrix(log_mat) # FALSE
is_not_square_numeric_matrix(str_mat) # TRUE
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.