dada2
dada2 copied to clipboard
mergePairs: inconsistent return
At least for dada2=1.22.0, mergePairs()
returns a list if there is > 1 sample, but it returns as data.frame if there is only one sample. This inconsistent return can cause problems downstream
The same goes for dada()
This is (weirdly I know) intentional behavior. It is not uncommon in R for the return value of a length 1 vector or list to be an object of the base type, rather than a vector/list of multiple such objects.
Pretty annoying behavior for scripting/programming, but usually what you prefer when working interactively.