chain {dembase} | R Documentation

## Chain concordances.

### Description

Combine two or more concordances to form a new concordance via a `merge`-like operation. For instance, if `x` is a concordance between classification `c1` and classification `c2`, and `y` is a concordance between `c2` and `c3`, then `chain(x, y)` creates a concordance between `c1` and `c3`.

### Usage

    chain(...)

### Arguments

`...` | Objects of class `Concordance`.

### Details

Two concordances that are to be chained together must have a classification in common. In addition, the two versions of the common classification must have the same set of values, though not necessarily in the same order. Concordances are merged from left to right.

### Value

An object of class `Concordance`.

### See Also

`splice` combines concordances via a `rbind`-like operation.

### Examples

    x <- cbind(c1 = c("a", "b", "c"), c2 = c("e", "f", "f"))
    x <- Concordance(x)
    y <- cbind(c2 = c("e", "f"), c3 = c("i", "j"))
    y <- Concordance(y)
    z <- cbind(c3 = c("i", "j"), c4 = c("m", "l"))
    z <- Concordance(z)
    x
    y
    z
    chain(x, y)
    chain(x, y, z)

    x <- cbind(c1 = c("a", "b"), c2 = c("e", "f"))
    x <- Concordance(x)
    y <- cbind(c3 = c("i", "j"), c2 = c("e", "f"))
    y <- Concordance(y)
    z <- cbind(c3 = c("i", "j", "k"), c2 = c("e", "e", "f"))
    z <- Concordance(z)
    x
    y
    z
    ## The order of the columns is irrelevant in a "OneToOne" object
    chain(x, y)
    ## ...but not a "ManyToOne" object
    ## Not run: chain(x, z)

[Package dembase version 0.0.0.119 Index]