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.
1 2 3 4 5
Number of gametes
Lexicographic state. Can be a vector of lexicographic states to be converted
Label. Can be a vector of labels to be converted
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.
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.
1 2 3 4 5 6 7 8