powered by
Creates a subset of the matrix along an axis.
matrix.subset(mat, indices, axis = 1, n_threads = 1)
Matrix subsetted along the appropriate axis. The object is an S4 class with methods for efficient computation by adelie.
The adelie matrix to subset.
adelie
Vector of indices to subset the matrix.
The axis along which to subset (2 is columns, 1 is rows).
Number of threads.
James Yang, Trevor Hastie, and Balasubramanian Narasimhan Maintainer: Trevor Hastie hastie@stanford.edu
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)
Run the code above in your browser using DataLab