Learn R Programming

multiplex (version 4.0)

reduc: Reduce Matrices or Arrays

Description

Function to reduce a matrix or an array with a given clustering vector.

Usage

reduc(x, clu, lbs, slbs, valued, row, col)

Value

A reduced matrix or a reduced three-dimensional array of the input data according to the clustering information.

Arguments

x

Matrix or a three-dimensional array to be reduced.

clu

Vector with class membership in x.

lbs

(optional) Vector with labels for the reduced structure.

slbs

(optional) Vector with string labels in the reduced structure.

valued

(optional and logical) Should the reduction preserve valued data?

row

(optional and logical) Reduction by rows.

col

(optional and logical) Reduction by columns.

Details

Given a partition, this function serves to reduce either a matrix representing e.g. a partial order structure. However, the reduction is also generalized to three-dimensional arrays representing multiple relations or affiliation networks with either row or col.

Notice that the “reduction” of a semigroup of x is made through a decomposition process that is computed with function decomp.

See Also

cngr, rbox, decomp

Examples

Run this code
# scan the multiplication table data
s <- matrix(data=c(1, 1, 1, 3, 3, 3, 3, 3, 3), nrow=3, ncol=3, byrow=TRUE)

# reduce the multiplication table
s |> reduc(clu=c(1,2,2))

Run the code above in your browser using DataLab