Description Usage Arguments Value Examples
Interchange all elements between two specified rows and columns in a matrix.
1 2 | # A matrix-like data
MatrixAlternative(data, sub, rep)
|
data |
A matrix to be processed. |
sub |
A positive integer. The first selected dimension. |
rep |
A positive integer. The second selected dimension. Default value is 1. |
return a matrix with interchanged rows and columns in two specified dimensions.
1 2 3 4 5 | library(plyr)
M <- matrix(1:9,3,3,1)
M
MatrixAlternative(M, 2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.