as.matrix.dsm {wordspace} | R Documentation |
Extract Matrix from DSM Object (wordspace)
Description
Extract the co-occurrence or score matrix from a DSM object.
Usage
## S3 method for class 'dsm'
as.matrix(x, what = c("auto", "M", "S"), ...)
Arguments
x |
an object of class |
what |
whether to extract the raw co-occurrence matrix ( |
... |
any additional arguments are ignored |
Details
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.
Value
Either the raw co-occurrence matrix or the score matrix of the DSM x
.
Note that unlike other as.matrix
methods, a sparse matrix in canonical DSM format may be returned.
Author(s)
Stephanie Evert (https://purl.org/stephanie.evert)
See Also
dsm
, dim.dsm
, dimnames.dsm
, dsm.is.canonical
Examples
as.matrix(DSM_TermTerm)
as.matrix(DSM_TermContext)
[Package wordspace version 0.2-8 Index]