Learn R Programming

parsec (version 1.1.1)

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 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 modalities. See details.
varlen
a vector of number of modalities of each variable. See details.

Value

  • an object of S3 class incidence.

Details

For reasons of efficiency 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 in order to identify the variables they refer to. The profiles are generated by the combinations of the varaibles modalities. The names of the profiles are the modelities of the variables concatenated observing the varaibles 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