Learn R Programming

parsec (version 1.2.7)

mrg: 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 incidence
mrg(lst, varmod = NULL, varlen = NULL)
# S3 method for character
mrg(
lst,
    varmod = lapply(as.list(varlen), function(x) 1:x),
    varlen = sapply(varmod, length)
)

Value

an object of S3 class incidence.

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.

Author

Alberto Arcagni

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.

See Also

var2prof, LE2incidence

Examples

Run this code
# 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)

Run the code above in your browser using DataLab