Part of permTest
is to determine what the alternative hypothesis is, and if you don't specify the alternative, it will figure it out by itself (which is sort of bootleg - you shouldn't decide on the test based on your data, but whatever). It does this by looking at the mean of the randomized data (which is captured in a variable called rand.ev
).
You have a warning and an error that in essence tell you what the problem is. The warning is
In mean.default(rand.ev, na.rm = TRUE) :
argument is not numeric or logical: returning NA
Which can be translated to 'when I generated random data, the results aren't numeric, so what's up with that?'. This probably means that you are feeding character data into permTest
, but only you can know that for sure. I get the same warning if I do something like
> mean(c(1,2,3,"a"))
[1] NA
Warning message:
In mean.default(c(1, 2, 3, "a")) :
argument is not numeric or logical: returning NA
The error is
Error in if (alt == "less") { : missing value where TRUE/FALSE needed
which comes from a test
if(alternative == "auto") {
alt <- ifelse(orig.ev < mean(rand.ev, na.rm=TRUE), "less", "greater")
and you have a missing value because rand.ev
isn't numeric, as the warning already noted, so in this case alt
won't be less
or greater
, it will be NA
, so when you do the test of alt == "less"
, you get the error because NA == "less"
, returns NA
, not TRUE
or FALSE
.
I found the following error message.
Error in which(genome == inst_pkgs[, "provider_version"]) :
error in evaluating the argument 'x' in selecting a method for function 'which': Error in `[.data.frame`(inst_pkgs, , "provider_version") :
undefined columns selected
Thank you.
Hmm... I think it might come from an unavailable genome, although the error message should be quite more clear.
Could you check if the genome is available with
You should see "BSgenome.Hsapiens.UCSC.hg19.masked" in the output.
If it's not installed, try installing it with biocLite.
It could also be due to out-of-date packages. Maybe you can try with biocValid and see if your setup is up-to date
Thank you. The issue is with the installed genome.
Cheers