When I multiply the matrix by one column, the result has a numeric number, not a matrix (for example, myMatrix [, 5] for a subset of the fifth column). Is there a compact way to subset to a single column, support matrix format and support row / column names without doing anything complicated, like this:
matrix( myMatrix[ , 5 ] , dimnames = list( rownames( myMatrix ) , colnames( myMatrix )[ 5 ] )
SFun28
source share