Function to check and modify the input class and type

check_matrix(mat, name)

Arguments

mat

data.frame, data.table, tibble. Object to be cast to matrix.

name

character. Name of the object to be cast.

Value

a 3d array if a 3d array is provided, else a matrix.