findAssocs: Find Associations in a Term-Document Matrix

View source: R/matrix.R

findAssocsR Documentation

Find Associations in a Term-Document Matrix

Description

Find associations in a document-term or term-document matrix.

Usage

## S3 method for class 'DocumentTermMatrix'
findAssocs(x, terms, corlimit)
## S3 method for class 'TermDocumentMatrix'
findAssocs(x, terms, corlimit)

Arguments

x

A DocumentTermMatrix or a TermDocumentMatrix.

terms

a character vector holding terms.

corlimit

a numeric vector (of the same length as terms; recycled otherwise) for the (inclusive) lower correlation limits of each term in the range from zero to one.

Value

A named list. Each list component is named after a term in terms and contains a named numeric vector. Each vector holds matching terms from x and their rounded correlations satisfying the inclusive lower correlation limit of corlimit.

Examples

data("crude")
tdm <- TermDocumentMatrix(crude)
findAssocs(tdm, c("oil", "opec", "xyz"), c(0.7, 0.75, 0.1))

tm documentation built on Sept. 11, 2024, 6:47 p.m.