Description Value Methods Note See Also Examples
Auxiliary functions to retrieve the indices of non-zero elements in sparse matrices.
A two-column matrix. Each row gives the row and column index of a
non-zero element in the supplied matrix x
.
returns the indices of non-zero elements in
matrices of class dgCMatrix
returns the indices of non-zero elements in
matrices of class matrix.csr
returns the indices of non-zero elements in
matrices of base class matrix
; equivalent to
which(x != 0, arr.ind=TRUE)
Originally we used the matrix.csr
class from SparseM, but we
have switched to the class dgCMatrix
from package Matrix, as
that package is part of the R distribution bundle now.
The idea is to have a function similar to
which(x != 0, arr.ind=TRUE)
if x
is a matrix.
1 2 3 4 5 6 7 |
Loading required package: Biobase
Loading required package: BiocGenerics
Loading required package: parallel
Attaching package: ‘BiocGenerics’
The following objects are masked from ‘package:parallel’:
clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
clusterExport, clusterMap, parApply, parCapply, parLapply,
parLapplyLB, parRapply, parSapply, parSapplyLB
The following objects are masked from ‘package:stats’:
IQR, mad, sd, var, xtabs
The following objects are masked from ‘package:base’:
anyDuplicated, append, as.data.frame, basename, cbind, colnames,
dirname, do.call, duplicated, eval, evalq, Filter, Find, get, grep,
grepl, intersect, is.unsorted, lapply, Map, mapply, match, mget,
order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank,
rbind, Reduce, rownames, sapply, setdiff, sort, table, tapply,
union, unique, unsplit, which.max, which.min
Welcome to Bioconductor
Vignettes contain introductory material; view with
'browseVignettes()'. To cite Bioconductor, see
'citation("Biobase")', and for packages 'citation("pkgname")'.
Loading required package: RColorBrewer
Loading required package: limma
Attaching package: ‘limma’
The following object is masked from ‘package:BiocGenerics’:
plotMA
Loading required package: Matrix
Loading required package: grid
Loading required package: lattice
[,1] [,2] [,3]
[1,] 0 0 0
[2,] 0 0 1
[3,] 0 0 0
[4,] 0 0 0
[5,] 0 0 -34
Formal class 'dgCMatrix' [package "Matrix"] with 6 slots
..@ i : int [1:2] 1 4
..@ p : int [1:4] 0 0 0 2
..@ Dim : int [1:2] 5 3
..@ Dimnames:List of 2
.. ..$ : NULL
.. ..$ : NULL
..@ x : num [1:2] 1 -34
..@ factors : list()
row col
[1,] 2 3
[2,] 5 3
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 0 0 0 0 0 0
[2,] 0 0 1 0 0 1
[3,] 0 0 0 0 0 0
[4,] 0 0 0 0 0 0
[5,] 0 0 -34 0 0 -34
row col
[1,] 2 3
[2,] 5 3
[3,] 2 6
[4,] 5 6
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.