I have the following data.frame in R:
> daily DoW Duration 1 Friday 14.0000000000000 2 Monday 21.0000000000000 3 Saturday 12.0000000000
You need to specify the levels in factor and then use order with indexing:
order
daily$DoW <- factor(daily$DoW, levels= c("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday")) daily[order(daily$DoW), ]