m should be a matrix.

mat_byname(data = NA, nrow = 1, ncol = 1, byrow = FALSE,
  dimnames = NULL, m = matrix(data = data, nrow = nrow, ncol = ncol,
  byrow = byrow, dimnames = dimnames), rowtype = NULL, coltype = NULL)

Arguments

data

a vector of values for m

nrow

the number of rows in m

ncol

the number of columns in m

byrow

tells whether to fill m by rows (TRUE) or columns (FALSE)

dimnames

row and column names for m

m

a matrix object

rowtype

the type for rows

coltype

the type for columns

Value

a mat_byname object

Details

If is.null(m), NULL is returned. If all(is.na(m)), NA is returned. If m is not a matrix, an error is given.

Examples

mat_byname(matrix(c(1:2)))
#> [,1] #> [1,] 1 #> attr(,"class") #> [1] "mat_byname" "matrix"