powered by
Extract the co-occurrence or score matrix from a DSM object.
# S3 method for dsm as.matrix(x, what = c("auto", "M", "S"), ...)
Either the raw co-occurrence matrix or the score matrix of the DSM x.
x
Note that unlike other as.matrix methods, a sparse matrix in canonical DSM format may be returned.
as.matrix
an object of class dsm
dsm
whether to extract the raw co-occurrence matrix (M) or the score matrix (S). The default option auto prefers the score matrix if both are available.
M
S
auto
any additional arguments are ignored
Stephanie Evert (https://purl.org/stephanie.evert)
This function ensures that the row and column names of the matrix are consistent with the row/column information tables of the DSM. For faster access to the matrix, simply use x$M or x$S directly.
x$M
x$S
dsm, dim.dsm, dimnames.dsm, dsm.is.canonical
dim.dsm
dimnames.dsm
dsm.is.canonical
as.matrix(DSM_TermTerm) as.matrix(DSM_TermContext)
Run the code above in your browser using DataLab