Learn R Programming

multiplex (version 2.3)

as.semigroup: Coerce to a Semigroup Object

Description

A generic function for coercing an R object to a semigroup class.

Usage

as.semigroup(x, labels = NULL)

Arguments

x
an array representing the semigroup
labels
label strings for the semigroup

Value

An object of the `Semigroup' class

Details

Since many of the functions in the multiplex package require an object of the `Semigroup' class, this function produces this class object from an array representing the semigroup structure.

See Also

convert, semigroup

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)

## make a semigroup object
as.semigroup(s)

Run the code above in your browser using DataLab