如何在R中添加重复值
我有一个数据集,其中y列中有重复值。当我使用ggplot绘制它们时,重复项将合并在一起,但是我需要分别绘制它们,以便所有数据点显示在图上。我不确定该怎么做,任何帮助将不胜感激!
这是我的代码:
ggplot(data, aes(x=feeding_type,y=dung_count,color=habitat))+
geom_point()
编辑:添加geom_point(position =“ jitter”),我得到了此图:
是否有有什么方法可以堆叠点,以便更明显地与每个变量一起使用哪个点?
I have a dataset where there are duplicate values in the y column. When I plot them using ggplot the duplicates are merged together, but I need them to be graphed separately so that all data points are shown on the graph. I'm not sure how to do this, any help would be appreciated!
Here is my code:
ggplot(data, aes(x=feeding_type,y=dung_count,color=habitat))+
geom_point()
Edit: After adding geom_point(position="jitter") I got this graph:
Is there any way to stack the dots so that it is more obvious which points go with each variable?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论