I have a column of a data frame, Game
, made up of the following: (No quotation marks)
"Euro Round 1 West"
"Euro Round 2 Broncos"
"Euro Round 3 Tigers"
"Euro Round 4 Tigers"
"Euro Round 5 Broncos"
"Euro Round 6 West"
"Premier12 Round 1 Eagles"
"Premier12 Round 10 Mac"
"Premier12 Round 11 Cats"
"Premier12 Round 12 Owls"
"Premier12 Round 13 Devils"
"Premier12 Round 14 Zebras"
"Premier12 Round 15 Cats"
"Premier12 Round 16 Zebras"
"Premier12 Round 17 Owls"
"Premier12 Round 2 Eagles"
...
I would like the DataFrame to be ordered by this column.
First alphabetically by 'Euro' or 'Premier12' and then numerically by 'Round _'
However as you can see above the second part, i.e numerical order is like so: 1, 10, 11, 12, 13, 14, 15, 16, 17, 2, 3, 4, ...
How can I fix this?
Also, would it be possible to have this but also to change the characters order and add in brackets like so:
"West (Euro Round 1)"
"Broncos (Euro Round 2)"
"Tigers (Euro Round 3)"
"Tigers (Euro Round 4)"
"Broncos (Euro Round 5)"
"West (Euro Round 6)"
"Eagles (Premier12 Round 1)"
"Eagles (Premier12 Round 2)"
"Devils (Premier12 Round 3)"
...
Or else:
"West, Euro Round 1"
"Broncos, Euro Round 2"
"Tigers, Euro Round 3"
"Tigers, Euro Round 4"
"Broncos, Euro Round 5"
"West, Euro Round 6"
"Eagles, Premier12 Round 1"
"Eagles, Premier12 Round 2"
"Devils, Premier12 Round 3"
...
Thanks
I've read How to sort a character vector where elements contain letters and numbers in R? , which is similar to my problem, but I can't figure it out