simplifyMatrix.Rd
Simplify matrix in case of single row/columns
simplifyMatrix(matrix)
matrix | A matrix of any dimension If only one row/column is present, the dimension is dropped and a vector will be returned |
---|
#> [,1] [,2] [,3] #> [1,] 0.67 0.68 -1.41 #> [2,] 0.46 -0.55 -0.19 #> [3,] -0.05 -2.02 1.09simplifyMatrix(testMatrix[1L,,drop=FALSE])#> [1] 0.67 0.68 -1.41simplifyMatrix(testMatrix[,1L,drop=FALSE])#> [1] 0.67 0.46 -0.05