Learn R Programming

wordspace (version 0.2-0)

check.dsm: Validate Internal Structure of DSM Object (wordspace)

Description

Validate the internal structure of a DSM object and return a list with information about the object.

Usage

check.dsm(model, validate = FALSE, nonneg.check = FALSE)

Arguments

model

an object of class dsm

validate

carry out extended validation of internal consistency? (may be expensive)

nonneg.check

if TRUE, check the co-occurrence (\(M\)) and/or score (\(S\)) matrix for non-negativity (may be expensive)

Value

Aborts with error message if any inconsistency is detected. Otherwise a list with the following items is returned:

nrow

number of rows (target terms) of the DSM

ncol

number of columns (features) of the DSM

N

sample size of the underlying data set (may be NA)

M$ok

whether co-occurrence frequency matrix \(M\) is available

M$sparse

whether \(M\) is sparse or dense (only present if M$ok)

M$canonical

whether \(M\) is in canonical DSM format (only present if M$ok)

M$nonneg

whether \(M\) is non-negative (only present if M$ok, and may be NA unless nonneg.check=TRUE was specified)

S$ok

whether score matrix \(S\) is available

S$sparse

whether \(S\) is sparse or dense (only present if S$ok)

S$canonical

whether \(S\) is in canonical DSM format (only present if S$ok)

S$nonneg

whether \(S\) is non-negative (only present if S$ok, and may be NA unless nonneg.check=TRUE was specified)

locked

TRUE if matrix combines data with inconsistent row or column marginals (in this case, association scores cannot be computed any more)

See Also

dsm, print.dsm

Examples

Run this code
# NOT RUN {
check.dsm(DSM_TermTerm)

# }

Run the code above in your browser using DataLab