permute: Rearrange a Data Matrix

permuteR Documentation

Rearrange a Data Matrix

Description

Rearranges a data matrix according to a permutation order.

Usage

permute(object, order, ...)

## S4 method for signature 'data.frame,PermutationOrder'
permute(object, order)

## S4 method for signature 'matrix,PermutationOrder'
permute(object, order)

Arguments

object

A m \times p numeric matrix or data.frame of count data (absolute frequencies giving the number of individuals for each category, i.e. a contingency table).

order

A PermutationOrder object giving the permutation order for rows and columns.

...

Currently not used.

Value

A permuted matrix or a permuted data.frame (the same as object).

Author(s)

N. Frerebeau

See Also

Other seriation methods: as_seriation(), assess(), order(), refine(), seriate_average(), seriate_rank()

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
order_rows(indices)
order_columns(indices)

## Permute columns
(new <- permute(compiegne, indices))

kairos documentation built on April 3, 2025, 7:08 p.m.