Learn R Programming

edgeR (version 3.8.6)

expandAsMatrix: expandAsMatrix

Description

Expand scalar or vector to a matrix.

Usage

expandAsMatrix(x, dim)

Arguments

x
scalar, vector or matrix. If a vector, length must match one of the output dimensions.
dim
required dimension for the output matrix.

Value

Numeric matrix of dimension dim.

Details

This function expands a row or column vector to be a matrix. It is used internally in edgeR to convert offsets to a matrix.

Examples

Run this code
expandAsMatrix(1:3,c(4,3))
expandAsMatrix(1:4,c(4,3))

Run the code above in your browser using DataLab