dada2 icon indicating copy to clipboard operation
dada2 copied to clipboard

mergePairs: inconsistent return

Open nick-youngblut opened this issue 2 years ago • 2 comments

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

nick-youngblut avatar Jul 02 '22 14:07 nick-youngblut

The same goes for dada()

nick-youngblut avatar Jul 02 '22 14:07 nick-youngblut

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.

benjjneb avatar Jul 12 '22 20:07 benjjneb