matrixs_to_df: Tidy matrix to data frame

Description Usage Arguments Details Value Examples

View source: R/tidy-data.R

Description

This function quickly converts a set of matrices into a data frame.

Usage

1
2
3
4
5
matrixs_to_df(x = list(), row.names = NULL, col.names = NULL,
  row.order = NULL, col.order = NULL, cluster.type = "none",
  cluster.method = NULL, tree.type = "none",
  row.tree.position = NULL, col.tree.position = NULL,
  row.tree.max.height = NULL, col.tree.max.height = NULL)

Arguments

x

a list of matrix-like object.

row.names

NULL (default) or a string vector for setting row names of matrix.

col.names

NULL (default) or a string vector for setting col names of matrix.

row.order

NULL (default), a numeric vector, "hclust" or "dendrogram" object for reordering the rows of matrix.

col.order

NULL (default), a numeric vector, "hclust" or "dendrogram" object for reordering the columns of matrix.

cluster.type

"none" (default), "all", "row" or "col" for reordering matrix.

cluster.method

a character string with the name of agglomeration method. Defaults to "complete" for numeric matrix, "osa" for ohter type matrix.

tree.type

"none" (default), "all", "row" or "col" for adding cluster tree.

row.tree.position

position of tree for rows, NULL (defualt), "right" or "left".

col.tree.position

NULL (defualt), "top" or "bottom", position of tree for columns.

row.tree.max.height

max height of tree for rows, NULL or postive value.

col.tree.max.height

max height of tree for columns, NULL or postive value.

Details

If there are more than one matrix, cluster only according to the first matrix.

Value

a data frame.

Examples

1
2
3
4
matrixs_to_df(x = mtcars)
m1 <- matrix(rnorm(100), nrow = 20)
m2 <- matrix(rnorm(100), nrow = 20)
matrixs_to_df(list(m1 = m1, m2 = m2))

houyunhuang/ggtriangle documentation built on May 11, 2020, 2:02 p.m.