I am trying to order a table that has 3 variables, commonly known as a 3-way table.
I have attached a picture of the structure of the table the replicable code will produce.

Is it possible to order this table in a logical way, despite the fact it is essentially split into three sections/groups? For instance, could you order by the column "No" or the column "Yes" based on the values? For example, when ordering "No" England would be ordered as "Sertosa" (7), Virginica (8), Versicolour (16). Wales would be ordered Versicolor (11), Setoda (12), Virginica... and so on for each section of the table.
#Replicable code using the Iris data built into R:
Data <- iris
Data $ var2 <- Data $ Species
Data $ var2 <- sample(Data $ var2)
Data $ var3 <- Data $ Species
Data $ var3 <- sample(Data $ var3)
#making the example clearer
library(plyr)
Data $ var2 <- revalue(Data $ var2, c("setosa"="No", "versicolor"="No","virginica" ="Yes"))
Data $ var3 <- revalue(Data $ var3, c("setosa"="England", "versicolor"="Wales","virginica" ="Scotland"))
#3-way Table:
df <- table(Data $ Species, Data $ var2, Data $ var3)
df
Kind Regards, James Prentice, a person trying to get to grips with R.