malucalle / selbal

selbal: selection of balances for microbial signatures
32 stars 15 forks source link

replacement has length zero #14

Open AlessandroLazzaro opened 4 years ago

AlessandroLazzaro commented 4 years ago

Hello, I would like to use selbal yo analyse my microbiome data. I created a dataset with only only the taxa of interest (only taxa present in more than 20% of the samples have been included), a column for a dichotomic variable (y) and another column containing dichitomic values too, to use as covariate. Unfortunately, running the command I obain this error. I tried to change the zero.rep parameter, but it is the same with both "one" or "bayes". I am sure that there aren't missing value in my dataset. I also tried to modify the zero in 1 out of RStudio and than to import the file without zeros, but the error provided was the same:

Error in learnmatrix[j + (i - 1) * fold, 1:length(whichj)] <- whichj : replacement has length zero In addition: Warning messages: 1: In if (classy == "factor") { : the condition has length > 1 and only the first element will be used 2: In if (strat & missing(y)) stop("If 'strat=TRUE', 'y' (class memberships) must be given \n") : the condition has length > 1 and only the first element will be used 3: In if (!strat) { : the condition has length > 1 and only the first element will be used

thank you for your help

UVic-omics commented 4 years ago

Hi @AlessandroLazzaro !

First of all thank you for using selbal. I am sorry, but it is difficult to know where the problem is by only reading the error message.

Let's see if step by step we can find the issue.

AlessandroLazzaro commented 4 years ago

Thank you for your answer!