mrg: Merge posets

View source: R/mrg.R

mrgR Documentation

Merge posets

Description

The function merges posets defined through a list of incidence matrices or a list of complete orders between the variables (argument lst). In the second case the variables must be defined (argument varmod or varlen).

Usage

mrg(
    lst,
    varmod = lapply(as.list(varlen), function(x) 1:x),
    varlen = sapply(varmod, length)
)
## S3 method for class 'incidence'
mrg(lst, varmod = NULL, varlen = NULL)
## S3 method for class 'character'
mrg(
lst,
    varmod = lapply(as.list(varlen), function(x) 1:x),
    varlen = sapply(varmod, length)
)

Arguments

lst

a list of incidence matrices (class incidence) or list of vectors of characters. See details.

varmod

list of variables and their grades. See details.

varlen

a vector of number of grades of each variable. See details.

Details

For efficiency reasons, the argument lst can be also a list of vectors of characters. In this case, each vector lists the names of the variables in increasing order.

The list varmod and the vector varlen must be named, so as to identify the variables they refer to. The profiles are generated by the combinations of the variables grades. The names of the profiles are the grades of the variables concatenated, according to variables order in varmod/varlen. See var2prof for more details about these arguments.

Value

an object of S3 class incidence.

Author(s)

Alberto Arcagni

See Also

var2prof, LE2incidence

Examples

# Example with lst as list of incidence matrices
Lambda <- getlambda(A < B, C < D)
plot(Lambda)
lst <- LE(Lambda)
vl <- c(A = 2, B = 2, C = 2, D = 2)
lstZeta <- LE2incidence(lst, varlen = vl)
for (x in lstZeta)
    plot(x)
mrg(lstZeta)

# Example with lst as list of characters
Lambda <- getlambda(A < B, C < D)
lst <- LE(Lambda)
vl <- c(A = 2, B = 2, C = 2, D = 2)
Zeta <- mrg(lst, varlen = vl)
plot(Zeta)

parsec documentation built on Aug. 19, 2023, 5:07 p.m.