Given an input matrix, try and simplify it to a scalar or vector. This requires that one or both of the dimensions are 1. If the matrix has dimnames() and the output has more than one item, name the elements according to the longest dimname.

lev_simplify_matrix(m)

Arguments

m

A matrix. If m is not a matrix it is returned unchanged.

Value

A scalar, vector or matrix as described above.