Sorts a named list by its names.

sort_nlist(x)

Arguments

x

The named list to sort.

Value

The sorted named list.

Examples

sort_nlist(list(y = 2, x = 1, a = 10))
#> $a
#> [1] 10
#> 
#> $x
#> [1] 1
#> 
#> $y
#> [1] 2
#>