ggpairs
提供带有两个箱形图连接点的图表,以显示干预前后的情况。
想要更改 y 轴标签“Resist”“Suscept”而不是“3GCr”和“3GCs”。
并希望使用 r 默认形状更改数据点,例如 Resist= circle (1) & Suscept= Diamond(5)
搜索了几个网站,但没有得到想要的结果。还要添加代码和输出:
df.reach.sub <- data.frame(Resist = c(5.78, 3.85, 5.60, 7.83, 6.68, 7.90), Suscept =c(5.70, 3.70, 8.82, 8.67, 9.06, 8.08), Age = c(1,1,1,1,1,1), Status = c("Positive", "Positive", "Positive", "Positive", "Positive", "Positive"))
df.reach.subCat1 <- df.reach.sub[which(df.reach.sub$Age == "1-3" & df.reach.sub$Status == "Positive"),]
gp.plotCat1 <- ggpaired(df.reach.subCat1, cond1 = "Resist", cond2 = "Suscept", color = "Black", line.color = "gray", line.size = 0.4, palette = "npg", ylab = expression('log'[10]*' CFU / g faeces'), xlab = NULL, main = expression("A) 1-3 months ("*italic('p = 0.116, n = 6')*')'), legend = "none", ggtheme = theme_bw(), ylim = c(2,10))
gp.plotCat1