During a discussion with Sam, we were wondering whether we could improve sweep(). The discussion only applies when sweeping multiple assays. Consider the following example:
This example divides all columns by arbitrary numbers, but these numbers are the same for all 3 assays. I don't see a reason in practice that a user wants to divide (or any other operation) their column by numbers that are shared across assays. Sam and I are mostly using sweep() to perform some sort of normalization (cf #79) where we want to divide or subtract the columns (or rows) by a column (or row) statistic, eg mean or median. The function does not allow for this.
I see two actions we could take:
We do not allow sweep on multiple assays, but this would limit the use cases for sweep.
The STATS argument should take a list of numeric vectors with as many elements as the length of i. This, however, increases the complexity of the user experience
During a discussion with Sam, we were wondering whether we could improve
sweep()
. The discussion only applies whensweep
ing multiple assays. Consider the following example:This example divides all columns by arbitrary numbers, but these numbers are the same for all 3 assays. I don't see a reason in practice that a user wants to divide (or any other operation) their column by numbers that are shared across assays. Sam and I are mostly using
sweep()
to perform some sort of normalization (cf #79) where we want to divide or subtract the columns (or rows) by a column (or row) statistic, eg mean or median. The function does not allow for this.I see two actions we could take:
STATS
argument should take a list of numeric vectors with as many elements as the length ofi
. This, however, increases the complexity of the user experience