permute {kairos} | R Documentation |
Rearranges a Data Matrix
Description
-
permute()
rearranges a data matrix according to a permutation order. -
get_order()
returns the seriation order for rows and/or columns.
Usage
permute(object, order, ...)
get_order(x, ...)
## S4 method for signature 'data.frame,PermutationOrder'
permute(object, order)
## S4 method for signature 'matrix,PermutationOrder'
permute(object, order)
## S4 method for signature 'PermutationOrder'
get_order(x, margin = c(1, 2))
Arguments
object |
A |
... |
Currently not used. |
x , order |
A |
margin |
A |
Value
-
permute()
returns a permutedmatrix
or a permuteddata.frame
(the same asobject
).
Author(s)
N. Frerebeau
See Also
Other seriation methods:
seriate_average()
,
seriate_rank()
,
seriate_refine()
Examples
## Replicates Desachy 2004 results
data("compiegne", package = "folio")
## Get seriation order for columns on EPPM using the reciprocal averaging method
## Expected column order: N, A, C, K, P, L, B, E, I, M, D, G, O, J, F, H
(indices <- seriate_rank(compiegne, EPPM = TRUE, margin = 2))
## Get permutation order
get_order(indices, 1) # rows
get_order(indices, 2) # columns
## Permute columns
(new <- permute(compiegne, indices))
## See the vignette
## Not run:
utils::vignette("seriation")
## End(Not run)