Subset a matrix
subset_cpp(m1in, rowidx_in, colidx_in)
m1in | an R matrix (expression matrix) |
---|---|
rowidx_in | a numeric vector of rows to keep |
colidx_in | a numeric vector of columns to keep |
a subsetted matrix
mat_test <-matrix(rnbinom(1000000,mu=0.01, size=10),nrow=100) subset_mat <- subset_cpp(mat_test, rowidx_in=c(1:10), colidx_in=c(100:500)) dim(subset_mat)#> [1] 10 401