我如何获得ggplot正确订购方面? [英] How do I get ggplot to order facets correctly?

查看:111
本文介绍了我如何获得ggplot正确订购方面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图根据从2-14运行的变量来分析14个地块。这些图表按顺序显示:
10,11,12,13,14,15,2,3,4,5,6,7,8,9

如何让他们从2-15订购?



更新:好的,所以我使用 data $ VAR = as.factor(数据是$ var)
级别为
级别:10 11 12 13 14 15 2 3 4 5 6 7 8 9



如何重新排序这些?

解决方案

如果没有您的数据,我最好的猜测就是将您的faceting变量根据您的需求订单中的水平。


I am trying to facet about 14 plots based on a variable that runs from 2-14. The plots show up in the order: 10,11,12,13,14,15,2,3,4,5,6,7,8,9

How do I get them to order from 2-15?

update: ok, so I made it a factor using data$var=as.factor(data$var). The Levels are Levels: 10 11 12 13 14 15 2 3 4 5 6 7 8 9

How do I reorder those?

解决方案

Without your data, my best guess would be to turn your faceting variable into a factor that has the levels in the order which you desire.

这篇关于我如何获得ggplot正确订购方面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆