View source: R/numericFunctions.R
anti_t | R Documentation |
The anti-transpose of a square matrix or table x
is the
transpose taken across the off-diagonal. anti-t
is a convenience
wrapper for apply(apply(x, 2, rev), 1, rev)
.
The anti-transpose function is useful, for example, for converting the
results of table(Test, Gold)
to a "confusion" matrix, and vice-versa.
A C implementation of the anti-transpose function can also be found as in
package gclm
as gclm:::anti_t
.
anti_t(x)
x |
A square matrix or table. |
The anti-transpose (transpose across the off-diagonal) of x
.
Gold <- rbinom(20, 1, 0.50)
Test <- Gold; Test[c(3, 5, 9, 12, 16)] <- 1 - Test[c(3, 9, 5, 12, 16)]
(tb <- table(Test, Gold))
anti_t(tb)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.