data2.aov<-aov(data2$y~factor(data2$x)) boxplot(data2$y~data2$x) post_hoc<-TukeyHSD(data2.aov, ordered=TRUE) print(post_hoc)