simplifyMatrix: Simplify matrix in case of single row/columns

Description Usage Arguments Examples

View source: R/utils.R

Description

Simplify matrix in case of single row/columns

Usage

1

Arguments

matrix

A matrix of any dimension

If only one row/column is present, the dimension is dropped and a vector will be returned

Examples

1
2
3
4
testMatrix <- matrix(round(rnorm(9),2), nrow=3)
simplifyMatrix(testMatrix)
simplifyMatrix(testMatrix[1L,,drop=FALSE])
simplifyMatrix(testMatrix[,1L,drop=FALSE])

BioQC documentation built on May 2, 2018, 3:40 a.m.