Reversed order after coord_flip in R

旧巷老猫 提交于 2019-11-28 23:08:15

You can add scale_x_discrete with the limits argument to do this. You could simply write out the limits in the order you want, but that gets complicated when you have many factor levels. Instead, you can pull the levels of the factor from your dataset and take advantage of rev to put them in reverse order.

It would look like: scale_x_discrete(limits = rev(levels(dbv$Sektion)))

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!