每个默认ggplot均按字母顺序订购离散数据。但是我找不到从星期一到星期天定购它们的方法。目前,我有以下代码:
bp1 <- ggplot(mydata, x=c("Monday","Tuesday","Wednesday", "Thursday","Friday","Saturday","Sunday")) +
ylab("Boxplots") +
theme(axis.title.x=element_blank()) +
geom_boxplot(fill = "#0000DD", aes(x=weekdays(date), y=var))
这将产生following plot。
如何订购星期一至星期日的日期?