Learn R Programming

Necklaces (version 1.0)

lSort: Sort a list of vectors

Description

The function takes in input a list of vectors and returns the same list ordered in a lexicographical way.

Usage

lSort(pL = list())

Value

list

the input list ordered in lexicographical way

Arguments

pL

list of vectors to be ordered

Author

Elvira Di Nardo elvira.dinardo@unito.it,
Giuseppe Guarino giuseppe.guarino@rete.basilicata.it

Details

The function takes as input a list of vectors and returns the same list ordered in a lexicographical way. For example if the input list is (2,2,3),(3,2,3),(1,2,3), then the output of the function lSort produces the following result: (1,2,3),(2,2,3),(3,2,3).

References

Flajolet, P., and Sedgewick, R. (2009) Analytic combinatorics. Cambridge University press.

See Also

cNecklaces, cBracelets, fNecklaces, Necklaces, Bracelets, LyndonW, sBruijn

Examples

Run this code
# Sort the following list (2,2,3),(3,2,3),(1,2,3) 
#
lSort(list(c(2,2,3),c(3,2,3),c(1,2,3)))

Run the code above in your browser using DataLab