corpus_clustering: corpus_clustering

Description Usage Arguments Value Examples

View source: R/clustering.R

Description

Run a hierarchical clustering on documents of a corpus based on a correspondence analysis. The number of axes from ca which are used depends on the value of the n argument passed to corpus_ca.

Usage

1
corpus_clustering(ca, n = 0)

Arguments

ca

A CA object resulting from a call to corpus_ca.

n

Number of clusters to create. If 0 (the default), it is determined by clicking on the plot to choose the cut height.

Value

A HCPC object.

Examples

1
2
3
4
5
file <- system.file("texts", "reut21578-factiva.xml", package="tm.plugin.factiva")
corpus <- import_corpus(file, "factiva", language="en")
dtm <- build_dtm(corpus)
res <- corpus_ca(corpus, dtm, ncp=2, sparsity=0.98)
corpus_clustering(res, 3)

R.temis documentation built on May 13, 2021, 1:08 a.m.