# Create a nested list
my_list = list(
b = list(d = 4, a = 2),
empty = list(),
'unnamed',
a = 1,
f = list(b = 3, a = list(d = seq(5), 'unnamed', c = 2))
)
# Sort the list recursively
sorted_list_recursive = sortlist(my_list)
print(sorted_list_recursive)
Run the code above in your browser using DataLab