Skip to contents

This function loops through a list of matrices and returns the minimum number of columns found across all matrices in the list.

Usage

min_columns_list(matrix_list)

Arguments

matrix_list

A list containing matrices. Non-matrix elements will be ignored with a warning.

Value

An integer representing the minimum number of columns across all matrices in the list.

Examples

mat1 <- matrix(1:6, nrow = 2)
mat2 <- matrix(1:12, nrow = 3)
mat3 <- matrix(1:4, nrow = 2)
min_columns_list(list(mat1, mat2, mat3)) # Returns 2
#> [1] 2