ex2 | R Documentation |

Example data sets used to demonstrate the handling of weights. The `'ex2.weighted'`

data set contains 6 sequences with weights inflating to 100 sequences (sum of weights is 100). The second data frame `'ex2.unweighted'`

contains the corresponding 100 sequences.

The sequences are, in both data frames, in the `'seq'`

column, and weights in the `'weight'`

column of `'ex2.weighted'`

.

The alphabet is made of four possible states: `A, B, C`

and `D`

.

These data sets are mainly intended to test and illustrate the handling of weights in TraMineR's functions. Weighted results obtained with '`ex2.weighted`

' data set should be exactly the same as unweighted results obtained with the '`ex2.unweighted`

' data set.

`data(ex2)`

The command `data(ex2)`

generates two data frames:

`ex2.weighted`

: a data frame with 6 rows, 1 variable containing sequences as character strings, 1 weight variable.

`ex2.unweighted`

: a data frame with 100 rows, 1 variable containing sequences as character strings.

The brain of the TraMineR package team.

```
data(ex2)
ex2w.seq <- seqdef(ex2.weighted, 1, weights=ex2.weighted$weight)
ex2u.seq <- seqdef(ex2.unweighted)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.