matWide2Long | R Documentation |
Reformats the upper triangular part (and, optionally, the diagonal) of a matrix from the wide format into the long format.
matWide2Long(
mat,
diag = TRUE,
outColNs = c("row", "col", "val"),
stringsAsFactors = FALSE
)
mat |
matrix |
diag |
if FALSE, the diagonal entries will be ignored |
outColNs |
names of the columns in the output |
stringsAsFactors |
if TRUE, character vectors will be converted to factors |
data frame
Zheyuan Li [aut] (https://stackoverflow.com/a/41745373/597069), Timothee Flutre [ctb]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.