# Lexicographic ordering

### Description

Lexicographic ordering of states is the same as the label order, but with invalid labels removed. For example, (1,1,1,3) will produce NA.

### Usage

1 2 3 4 5 |

### Arguments

`ngam` |
Number of gametes |

`lex` |
Lexicographic state. Can be a vector of lexicographic states to be converted |

`label` |
Label. Can be a vector of labels to be converted |

### Details

Note that conversions are made by listing all the labels and their corrsespondign lexicographic state, so this function may not be practical for large numbers of gametes.

When converting lex to label, there may be several possible labels, in which case the minimum is taken.

### Value

In allLex a vector of lexicographic states is produced for each label. The labels are the names of the vector elements.

In lex2label and label2lex the requested integer or vector of integers is produced.

### Author(s)

Fiona Grimson

### Examples

1 2 3 4 5 6 7 8 |