as_matrixset {matrixset}R Documentation

Coerce object into matrixset

Description

Turns object into a matrixset. See specific methods for more details

Usage

as_matrixset(
  x,
  expand = NULL,
  row_info = NULL,
  column_info = NULL,
  row_key = "rowname",
  column_key = "colname",
  row_tag = ".rowname",
  column_tag = ".colname"
)

Arguments

x

an object to coerce to matrixset. See methods.

expand

By default (NULL), input matrix expansion is disabled. Setting this parameter to TRUE will enable the expansion feature. See the section ‘Matrix Expansion’ of matrixset() for more details of what it is, as well as other possible options for expand. Note as well that this argument is not available for all methods.

row_info

a data frame, used to annotate matrix rows. The link between the matrix row names and the data frame is given in column "rowname". A different column can be used if one provides a different row_key.

column_info

a data frame, used to annotate matrix columns. The link between the matrix column names and the data frame is given in column "colname". A different column can be used if one provides a different column_key.

row_key

column name in row_info data frame that will link the row names with the row information. A string is expected.

column_key

column name in col_info data frame that will link the column names with the row information. A string is expected.

row_tag

A string, giving the row annotation data frame column that will link the row names to the data frame. While row_key specifies the column name of the data frame at input, row_tag specifies the column name that will be used throughout in the matrixset object.

column_tag

A string, giving the column annotation data frame column that will link the row names to the data frame. While column_key specifies the column name of the data frame at input, column_tag specifies the column name that will be used throughout in the matrixset object.

Value

Returns a matrixset - see matrixset().

Methods

Examples

# We're showing how 'as_matrixset' can differ. But first, show how they can
# yield the same result. Note that the list is named
lst <- list(a = matrix(1:6, 2, 3), b = matrix(101:106, 2, 3))
identical(matrixset(lst), as_matrixset(lst))

# Now it will differ: the list is unnamed. In fact, 'matrixset' will fail
lst <- list(matrix(1:6, 2, 3), matrix(101:106, 2, 3))
is(try(matrixset(lst), silent = TRUE), "try-error")
as_matrixset(lst)

# You need to name the matrix to use 'matrixset'. A name is provided for you
# with 'as_matrixset'. But you can't control what it is.
as_matrixset(matrix(1:6, 2, 3))


[Package matrixset version 0.3.0 Index]