r语言 - 有没有办法在 x 轴上将"high"的位置向右切换,"low"向左切换?



我刚刚通过双向方差分析进行了交互分析并创建了我的图形。不幸的是,在 x 轴上,条件高总是在左侧,条件低在右侧。但是我希望条件在x轴的左侧"低"和"高"在右侧。

我已经尝试以相反的方式导入我的数据,因此,条件低 x 低在我的列表顶部,在列表的 and 中,有条件高 x 高的数据。

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))

没有错误消息,但我仍然想更改布局。

只需重新调整因子变量(高和低是因子水平,R 按字母顺序排列(:

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

最新更新