1

I wish you can help me. I want to modify the ggpairs output for the following code:

install.packages("GGally")
library(GGally)
cor.iris= ggpairs(iris, aes(color=iris$Species, alpha=0.5))
cor.iris

ggpairs output

  1. conucting t-test and adding the significance level. for example, the boxplot of "species" vs "Sepal.Length" should look like the following graph:
install.packages("ggpubr")
install.packages("rstatix")
library(ggpubr)
library(rstatix)
stat.test <- iris %>% t_test(Sepal.Length ~ Species)
stat.test
stat.test <- stat.test %>% add_xy_position(x = "Species")
bxp <- ggboxplot(iris, x = "Species", y = "Sepal.Length", fill = "Species")
bxp + stat_pvalue_manual(stat.test, label = "p.adj.signif", tip.length = 0.01)

enter image description here

  1. removing the last row of the matrix (I don't need the Histograms).

Thanks for your help!

maya zadok
  • 23
  • 4

0 Answers0