Transforms values in the expression matrix to numeric, to make it compatible with the rest of the functions.

cast_matrix_to_numeric(expression.matrix)

Arguments

expression.matrix

The expression matrix (usually read from a file)

Value

The expression matrix transformed to numeric, preserving row and column names. Any values that are not coercible to numeric are replaced by 0.

Examples

cast_matrix_to_numeric(matrix( c(1, "2", 3.0, 4), ncol=2, dimnames=list(paste0("X", 1:2), paste0("Y", 1:2))))
#> Y1 Y2 #> X1 1 3 #> X2 2 4