Description Usage Arguments Details Value Author(s) See Also Examples
This utility function rearranges the row and/or the column variables in a desired order.
1 |
datamat |
numeric matrix containing the transposable data. |
N |
positive integer number indicating the sample size, i.e., the number of subjects. |
order.rows |
numeric vector displaying the desired order of the row variables. |
order.cols |
numeric vector displaying the desired order of the column variables. |
It is assumed that there are nrow(datamat)
row variables and
ncol(datamat)
/N
column variables in datamat
. Further,
datamat
should be written in such a way that every
ncol(datamat)
/N
consecutive columns belong to the same subject
and the order of the column variables in each block is preserved across
subjects.
Returns a matrix of the same size as datamat
.
Anestis Touloumis
meanmat.ts
and meanmat.hat
.
1 2 3 4 5 6 7 8 9 10 | data(VEGFmouse)
set.seed(1)
tissuesold <- colnames(VEGFmouse[ ,1:9])
## Suppose that you want to order the tissues in the folowing order.
tissuesnew <- colnames(VEGFmouse[ ,1:9])[sample(9)]
tissuesnew
## To do this, create a numeric vector with the desired order.
ordtis <- pmatch(tissuesnew, tissuesold)
VEGFmousenew <- orderdata(datamat = VEGFmouse, N = 40, order.cols = ordtis)
colnames(VEGFmousenew)[1:9]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.