Learn R Programming

wordspace (version 0.2-8)

t.dsm: Swap the Rows and Columns of a DSM Object (wordspace)

Description

Given a distributional model x, t(x) returns a new DSM object representing the transposed co-occurrence and/or score matrix. Marginal frequencies and other row/column information are updated accordingly.

Usage

# S3 method for dsm
t(x)

Value

A dsm object with rows and columns swapped.

Arguments

x

an object of class dsm

Author

Stephanie Evert (https://purl.org/stephanie.evert)

See Also

dsm

Examples

Run this code

tdm <- DSM_TermContext # term-document model
tdm$M

dtm <- t(tdm) # document-term model
dtm$M

Run the code above in your browser using DataLab