ggpubr
ggpubr copied to clipboard
compare_means Error in (function (x, cutpoints = ...............
Hi everyone,
I am not able to figure out what is happening and why sometimes compare_means() is giving me this error:
``
Error in (function (x, cutpoints = c(0.3, 0.6, 0.8, 0.9, 0.95), symbols = if (numeric.x) c(" ", : argument "x" is missing, with no default In addition: Warning message: Unknown or uninitialised column: `p
`.
My data is looking like this:
dry.wet.b <- read.csv("~/wd/dry.wet.b.csv", sep="\t") head(dry.wet.b) receiver donor compound 1 PMV_2_maxbin.002 Planctomycetota PMV_2_maxbin.003 Patescibacteria M_ac_e 2 PMV_2_maxbin.002 Planctomycetota PMV_2_maxbin.003 Patescibacteria M_acald_e 3 PMV_2_maxbin.002 Planctomycetota PMV_2_maxbin.003 Patescibacteria M_arg__L_e 4 PMV_2_maxbin.002 Planctomycetota PMV_2_maxbin.003 Patescibacteria M_glyc3p_e 5 PMV_2_maxbin.002 Planctomycetota PMV_2_maxbin.003 Patescibacteria M_h2s_e 6 PMV_2_maxbin.002 Planctomycetota PMV_2_maxbin.003 Patescibacteria M_h_e smetana condition 1 0.0084 DRY 2 0.0087 DRY 3 0.0006 DRY 4 0.0006 DRY 5 0.0264 DRY 6 0.0090 DRY
If I run:
compare_means(smetana~condition,dry.wet.b,group.by = "compound",method = "wilcox.test",p.adjust.method = "BH") All is good:
A tibble: 76 x 9
compound .y. group1 group2 p p.adj p.format p.signif method
1 M_ac_e smetana DRY WET 8.76e- 4 2.60e- 3 0.00088 *** Wilcoxon
2 M_acald_e smetana DRY WET 5.43e- 8 4.10e- 7 5.4e-08 **** Wilcoxon
3 M_arg__L_e smetana DRY WET 2.50e- 4 7.90e- 4 0.00025 *** Wilcoxon
4 M_glyc3p_e smetana DRY WET 9.20e- 1 9.70e- 1 0.92034 ns Wilcoxon
5 M_h2s_e smetana DRY WET 2.98e-60 2.30e-58 < 2e-16 **** Wilcoxon
6 M_h_e smetana DRY WET 2.12e- 6 1.20e- 5 2.1e-06 **** Wilcoxon
7 M_nh4_e smetana DRY WET 1.89e- 3 5.30e- 3 0.00189 ** Wilcoxon
8 M_etoh_e smetana DRY WET 8.08e- 1 9.00e- 1 0.80800 ns Wilcoxon
9 M_fe2_e smetana DRY WET 2.38e- 2 5.50e- 2 0.02383 * Wilcoxon
10 M_hom__L_e smetana DRY WET 3.41e- 1 4.50e- 1 0.34101 ns Wilcoxon
… with 66 more rows
But with the same commend when grouping by receiver I get the error:
compare_means(smetana~condition,dry.wet.b,group.by = "receiver",method = "wilcox.test",p.adjust.method = "BH")
Error in (function (x, cutpoints = c(0.3, 0.6, 0.8, 0.9, 0.95), symbols = if (numeric.x) c(" ", :
argument "x" is missing, with no default
In addition: Warning message:
Unknown or uninitialised column: p
.
Please help!
Thank you! iulia