R: Align sequence length among domains

seqlength.align {TraMineR} | R Documentation

## Align sequence length among domains

### Description

Sets lengths of sequences of multiple domains as the shortest lengths among domains.

### Usage

     seqlength.align(seq.list)

### Arguments

`seq.list` | list of sequence objects (of class `stslist`) created with the `seqdef` function. The sequence objects must all have the same number of sequences.

### Details

Sequences in the sequence objects are assumed to be ordered conformably. The length of the i-th sequence in each domain is set as the length of the shortest i-th sequence among the domains. The reduction of length is done by filling end positions with voids.

### Author(s)

Gilbert Ritschard

### See Also

`seqlength`

### Examples

    ## Using the ex1 data set with sequences of different length
    data(ex1)
    s1 <- seqdef(ex1[,1:13])
    seqlength(s1)

    ## sequence object s2 with a shorter 1st sequence

    s2 <- s1
    s2[1,8:13] <- attr(s2,"void")
    seqlength(s2)

    ## aligning sequence lengths
    seqlength.align(list(s1,s2))

[Package TraMineR version 2.2-4 Index]