tf: Term Frequency

Description Usage Arguments Examples

View source: R/features.R

Description

Compute term-frequency.

Usage

1
2
3
4
5
6
7
tf(dtm)

## S3 method for class 'dtm'
tf(dtm)

## S3 method for class 'JuliaObject'
tf(dtm)

Arguments

dtm

An object of class document_term_matrix as returned by document_term_matrix.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
init_textanalysis()

# build document
doc1 <- string_document("First document.")
doc2 <- string_document("Second document.")

corpus <- corpus(doc1, doc2)

update_lexicon(corpus)
m <- document_term_matrix(corpus)
tf(m)

## End(Not run)

news-r/textanalysis documentation built on Nov. 4, 2019, 9:40 p.m.