R Under development (unstable) (2026-01-21 r89314 ucrt) -- "Unsuffered Consequences" Copyright (C) 2026 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(ribiosUtils) > > set.seed(1887) > mat1 <- matrix(1:12, nrow=4L, ncol=3L, + dimnames=list(c("A", "B", "C", "D"), c("HSV", "FCB", "BVB"))) > mat1.longdf <- matrix2longdf(mat1) > stopifnot(identical(as.character(mat1.longdf$row), + rep(LETTERS[1:4], 3L))) > stopifnot(identical(as.character(mat1.longdf$column), + rep(c("HSV", "FCB", "BVB"), each=4L))) > stopifnot(identical(mat1.longdf$value, 1:12)) > > mat2 <- matrix(as.character(rnorm(100)), + nrow=10, ncol=10) > mat2.longdf <- matrix2longdf(mat2) > mat2.longdf2 <- matrix2longdf(mat2, row.names=LETTERS[1:10], col.names=letters[1:10]) > mat2.longdf3 <- matrix2longdf(mat2, row.names=LETTERS[1:10]) > mat2.longdf4 <- matrix2longdf(mat2, col.names=letters[1:10]) > > ## inconsistent length > suppressWarnings(mat2.longdf.incons <- matrix2longdf(mat2, col.names=letters[1:5])) > > proc.time() user system elapsed 0.14 0.03 0.15