matrix.subset {adelie} | R Documentation |
Creates a subset of the matrix along an axis.
Description
Creates a subset of the matrix along an axis.
Usage
matrix.subset(mat, indices, axis = 1, n_threads = 1)
Arguments
mat |
The |
indices |
Vector of indices to subset the matrix. |
axis |
The axis along which to subset (2 is columns, 1 is rows). |
n_threads |
Number of threads. |
Value
Matrix subsetted along the appropriate axis. The object is an S4 class with methods for efficient computation by adelie.
Author(s)
James Yang, Trevor Hastie, and Balasubramanian Narasimhan
Maintainer: Trevor Hastie hastie@stanford.edu
Examples
n <- 100
p <- 20
X <- matrix.dense(matrix(rnorm(n * p), n, p))
indices <- c(1, 3, 10)
out <- matrix.subset(X, indices, axis=1)
out <- matrix.subset(X, indices, axis=2)
[Package adelie version 1.0.8 Index]