Learn R Programming

multiplex (version 3.7)

as.semigroup: Coerce Relational System into a Semigroup Object

Description

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

Usage

as.semigroup(x, gens = NA, lbs, numerical, edgeT)

Value

An object of the ‘Semigroup’ class

ord

a number with the dimension of the semigroup

st

the strings, i.e. a vector of the unique relations

gens

the semigroup generators

S

the multiplication table of the semigroup

Arguments

x

an array representing the semigroup

gens

array or vector representing the semigroup generators

lbs

(optional) label strings for the semigroup

numerical

(optional and logical) should the semigroup have numerical format?

edgeT

(optional and logical) is ‘x’ an edge table?

Author

Antonio Rivero Ostoic

Details

Because some of the routines 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

semigroup, green.rel

Examples

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

# set attributes to 's'
attr(s, "dimnames") <- list(1:3, 1:3)

# make a semigroup object
as.semigroup(s)

Run the code above in your browser using DataLab