Suppose we have the following list of characters:
mylist <- list(c("I312","Z432","O115"),
c("S123"),
c("O978","T213"),
c("T123"))
mylist
[[1]]
[1] "I312" "Z432" "O115"
[[2]]
[1] "S123"
[[3]]
[1] "O978" "T213"
[[4]]
[1] "T123"
First I want to order within elements of mylist and then beetween elements of mylist due to the first component. The result should be as:
[[1]]
[1] "I312" "O115" "Z432"
[[2]]
[1] "O978" "T213"
[[3]]
[1] "S123"
[[4]]
[1] "T123"
Thanks for any help.