matrix.concatenate: Creates a concatenation of the matrices.

View source: R/matrix.R

matrix.concatenateR Documentation

Creates a concatenation of the matrices.

Description

Creates a concatenation of the matrices.

Usage

matrix.concatenate(mats, axis = 2, n_threads = 1)

Arguments

mats

List of matrices.

axis

The axis along which the matrices will be joined. With axis = 2 (default) this function is equivalent to cbind() and axis = 1 is equivalent to rbind().

n_threads

Number of threads.

Value

Concatenation of matrices. The object is an S4 class with methods for efficient computation in C++ by adelie. Note that for the object itself axis is represented with base 0 (so 1 less than the argument here).

Author(s)

Trevor Hastie and James Yang
Maintainer: Trevor Hastie hastie@stanford.edu

Examples

n <- 100
ps <- c(10, 20, 30)
ps <- c(10, 20, 30)
n <- 100
mats <- lapply(ps, function(p) {
    matrix.dense(matrix(rnorm(n * p), n, p))
})
out <- matrix.concatenate(mats, axis=2)

adelie documentation built on Sept. 11, 2024, 6:36 p.m.