vec2mat: Convert a vector to a matrix

View source: R/utils.R

vec2matR Documentation

Convert a vector to a matrix

Description

Convert a vector to a matrix

Usage

vec2mat(v, axis = c("col", "row"))

Arguments

v

Vector.

axis

One of "col" (default) or "row".

Value

The vector v as a matrix. If axis=="col" (default) the column vector v is returned as a length(v) times 1 matrix. If axis=="row", the vector v is returned as a transposed 1 times length(v) matrix.

Examples

vec2mat(c(2, 7, 3, 8), "col")

EQRN documentation built on April 4, 2025, 12:45 a.m.