kassambara / rstatix

Pipe-friendly Framework for Basic Statistical Tests in R
https://rpkgs.datanovia.com/rstatix/
440 stars 50 forks source link

Error in if (f.lower <= 0) return(mumin) : missing value where TRUE/FALSE needed #167

Open marwa38 opened 1 year ago

marwa38 commented 1 year ago
    A reproducible script with a demo data are needed so that I can help efficiently.

Originally posted by @kassambara in https://github.com/kassambara/rstatix/issues/79#issuecomment-778740908

Hi @kassambara I got the same error (Error in if (f.lower <= 0) return(mumin) : missing value where TRUE/FALSE needed) and here is a reproducible example

ps.prev.phylum is attached as .zip of .rds vector that you can read as follow ps.prev.phylum <- readRDS("ps.prev.phylum.rds") ps.prev.phylum.zip

# psmelt 
ps.prev.phylum_melt <- ps.prev.phylum %>%
  psmelt()
# log transform
ps.prev.phylum_melt$logAbundance <- log10(1 + ps.prev.phylum_melt$Abundance)
# select only Fusobacteriota
ps.prev.phylum_melt.fuso <- subset(ps.prev.phylum_melt, subset = Phylum == "Fusobacteriota")
# pairwise wilcox 
ps.prev.phylum_melt.fuso.pairwise <- pairwise_wilcox_test(ps.prev.phylum_melt.fuso,
                                                           Abundance ~ Sample_Regime,
                                                           p.adjust.method = "BH")
Error in if (f.lower <= 0) return(mumin) : missing value where TRUE/FALSE needed
ruutmdlv commented 1 year ago

I'm having the same issue: "Error in if (f.lower <= 0) return(mumin) : missing value where TRUE/FALSE needed". In my case the data are numbers all between [-1, 1] for one column and binary values (either 0 or 1) for the other.

Thanks.