R 有没有办法在x轴上将“高”位置切换到右侧,将“低”位置切换到左侧?

R 有没有办法在x轴上将“高”位置切换到右侧,将“低”位置切换到左侧?,r,ggplot2,ggpubr,R,Ggplot2,Ggpubr,我只是通过双向方差分析做了一个交互分析,并创建了我的图形。不幸的是,在x轴上,高状态总是在左侧,低状态总是在右侧。但我希望条件在x轴的左侧低,右侧高 我已经尝试以另一种方式导入数据,因此,条件low x low位于列表顶部,并且在列表的和处显示条件high x high的数据 ggline(dataH3, x= "news_source", y="sharing_intention", color = "rec_source", add = c("mean_se"), palet

我只是通过双向方差分析做了一个交互分析,并创建了我的图形。不幸的是,在x轴上,高状态总是在左侧,低状态总是在右侧。但我希望条件在x轴的左侧低,右侧高

我已经尝试以另一种方式导入数据,因此,条件low x low位于列表顶部,并且在列表的和处显示条件high x high的数据

ggline(dataH3, x= "news_source", y="sharing_intention", color = "rec_source", 
       add = c("mean_se"), palette = c("blue", "red"), shape=1, 
       title = "The Effect of News Source Credibility on Sharing Intention", xlab = "News Source Recommendation", 
       ylab = "Sharing Intention", legend.title = "Recommendation source credibility", ggtheme = theme_bw()) + 
       theme(plot.title = element_text(hjust = 0.5))

没有错误消息,但我仍希望更改布局。

只需重新设置因子变量“高”和“低”是因子级别,并按字母顺序排序:

dataH3$news_source <- factor(dataH3$news_source, levels = c("low", "high"))

你能发布样本数据吗?请使用dputdataH3的输出编辑问题。或者,如果dputheaddataH3,20的输出太大。非常感谢!那正是我要找的!