Learn R Programming

parsec (version 1.1.1)

lexLE2incidence: Convert lexicographic linear extensions into incidence matrices of profiles

Description

The function generates the incidence matrices of the profiles of lexicographic linear extensions starting from the variables definition (argument varmod or varlen) and a list of complete orders between the varaibles (argiment lst).

Usage

lexLE2incidence(
    lst,
    varmod = lapply(as.list(varlen), function(lst) 1:lst),
    varlen = sapply(varmod, length)
)
## S3 method for class 'default':
lexLE2incidence(
    lst,
    varmod = lapply(as.list(varlen), function(lst) 1:lst),
    varlen = sapply(varmod, length)
)
## S3 method for class 'list':
lexLE2incidence(
    lst,
    varmod = lapply(as.list(varlen), function(x) 1:x),
    varlen = sapply(varmod, length)
)

Arguments

lst
a vector of characters, or a list of vectors of characters. Each vector indicates the names of the variables in increasing order. 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 or a list of objects of S3 class incidence.

Details

The argument lst is a list of vectors of characters. Each vector lists the variables names 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

Examples

Run this code
Lambda <- getlambda(A < B, C < D)
plot(Lambda)
lst <- lexLE(Lambda)
vl <- c(A = 2, B = 2, C = 2, D = 2)
lstZeta <- lexLE2incidence(lst, varlen = vl)
for (x in lstZeta)
    plot(x)

Run the code above in your browser using DataLab