tfidf: tfidf

Description Usage Arguments Value Examples

View source: R/tfidf.R

Description

Computes the term frequency–inverse document frequency uses tha cosine of the angles between the documents as similarity measure. Since R source code is provided no stemming or stop words are applied.

Usage

1
tfidf(docs)

Arguments

docs

document object

Value

similarity matrix

Examples

1
2
3
4
5
6
7
8
9
files <- list.files(system.file("examples", package="rscc"), "*.R$", full.names = TRUE)
prgs  <- sourcecode(files, basename=TRUE, silent=TRUE)
docs  <- documents(prgs)
tfidf(docs)
# further steps
# m  <- tfidf(docs)
# df <- matrix2dataframe(m)
# head(df, n=20)
# browse(prgs, df, n=5)

rscc documentation built on Jan. 20, 2022, 5:08 p.m.