lev_simplify_matrix: Simplify a matrix

View source: R/lev-distance.R

lev_simplify_matrixR Documentation

Simplify a matrix

Description

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.

Usage

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.


levitate documentation built on Oct. 1, 2023, 1:08 a.m.