matrix_to_list_of_cols function

Turn a Matrix Into a List of Columns or Rows

Turn a Matrix Into a List of Columns or Rows

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

matrix_to_list_of_cols(m) matrix_to_list_of_rows(m)

Arguments

  • m: A matrix

Returns

  • 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.

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.

Examples

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