Resamples two matrices to match number of rows in each. Number of rows is matched to minimum or maximum, as specified.

balanceMatrixSize(mat.1, mat.2, method = "match.max")

Arguments

mat.1

First input matrix.

mat.2

Second input matrix.

method

Character specifying which matching method to use. Must be one of "match.max" (default) or "match.min". For either option, matrix with min/max number of rows is resamples to match the other matrix.

s.mat

similarity matrix

Value

list of resampled matrices.

Author

Nicholas Mikolajewicz

Examples


# ensure sample sizes are balanced across groups
output.mat <- balanceMatrixSize(de.orig.1, de.orig.2, method = "match.max")
#> Error in nrow(mat.1): object 'de.orig.1' not found
de.1 <- output.mat[["de.1"]] # resampled mat.1
#> Error in eval(expr, envir, enclos): object 'output.mat' not found
de.2 <- output.mat[["de.2"]] # resampled mat.2
#> Error in eval(expr, envir, enclos): object 'output.mat' not found
datExpr.noz <- output.mat[["de.all"]] # concatenated matrices
#> Error in eval(expr, envir, enclos): object 'output.mat' not found