matrix_to_vector: convert a matrix to a 1d vector

View source: R/utilities.R

matrix_to_vectorR Documentation

convert a matrix to a 1d vector

Description

convert a matrix to a 1d vector

Usage

matrix_to_vector(mat, by = "column")

Arguments

mat

matrix

by

one of column, row: concatenate column- or rowwise

Examples

test_mat = matrix(1:12, ncol=4, byrow = FALSE)
test_mat
matrix_to_vector(test_mat)
matrix_to_vector(test_mat, by ='row')

mathosi/jj documentation built on Feb. 25, 2024, 2:29 p.m.