Sort order splitis the factor order of your grouping variable. So, if your grouping variable is a factor, then the levels of this factor remain untouched.
Example: change your data to fachave levels c("blueb","bluea"):
dat.exmpl <- data.frame(
a=11:20,
b=rep(3,10),
fac=factor(rep(c("blueb","bluea")), levels=c("blueb","bluea"))
)
Then the results splitare in the same order as the levels fac:
split(dat.exmpl, dat.exmpl$fac)
$blueb
a b fac
1 11 3 blueb
3 13 3 blueb
5 15 3 blueb
7 17 3 blueb
9 19 3 blueb
$bluea
a b fac
2 12 3 bluea
4 14 3 bluea
6 16 3 bluea
8 18 3 bluea
10 20 3 bluea
source
share