matrix_to_list_of_cols: Turn a Matrix Into a List of Columns or Rows

View source: R/util.R

matrix_to_list_of_colsR Documentation

Turn a Matrix Into a List of Columns or Rows

Description

Given a matrix, create a list, each element of which contains a column or row from the matrix.

Usage

matrix_to_list_of_cols(m)

matrix_to_list_of_rows(m)

Arguments

m

A matrix

Details

matrix_to_list_of_cols() and 'matrix_to_list_of_rows() are internal functions, for use by developers, and would not normally be called directly by end users.

Value

  • matrix_to_list_of_cols() A list of vectors, each of which is a column from x.

  • matrix_to_list_of_rows(), A list of vectors, each of which is a row from x.

Examples

m <- matrix(1:12, nrow = 3)
matrix_to_list_of_cols(m)
matrix_to_list_of_rows(m)

poputils documentation built on Sept. 14, 2024, 9:07 a.m.