Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/overlapMatrix.R
Compute a p-by-J
sparse matrix indicating which group(s) the variable(s) belong(s) to.
1 | incidenceMatrix(X, group)
|
X |
The design matrix, without an intercept, as in |
group |
A list of vectors containing group information, as in |
This function is intended to provide an interface for users to construct the so-called
incidence matrix, denoted as M
, with dimension p-by-J, where p
is the number of variables, and J
is the number of groups. If variable i
is contained by group
j
, then M[i, j] = 1
; otherwise, M[i, j] = 0
.
Note that since a variable can be contained by multiple groups, so the sum of row M[i, ]
can be larger than 1.
A sparse p-by-J
matrix as described above.
Yaohui Zeng <yaohui-zeng@uiowa.edu>
1 2 3 4 5 | data(pathway.dat)
X <- pathway.dat$expression
group <- pathway.dat$pathways
incidence.mat <- incidenceMatrix(X, group)
dim(incidence.mat)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.