makeWordlist: Counts Words in Text Corpora

Description Usage Arguments Details Value Examples

View source: R/makeWordlist.R

Description

Creates a wordlist and a frequency table.

Usage

1
makeWordlist(text, k = 100000L, ...)

Arguments

text

List of texts.

k

Integer: How many texts should be processed at once (RAM usage)?

...

further arguments for the sort function. Often you want to set method = "radix".

Details

This function helps, if table(x) needs too much RAM.

Value

words

An alphabetical list of the words in the corpus

wordtable

A frequency table of the words in the corpus

Examples

1
2
3
4
5
6
7
8
texts <- list(A="Give a Man a Fish, and You Feed Him for a Day.
Teach a Man To Fish, and You Feed Him for a Lifetime",
B="So Long, and Thanks for All the Fish",
C="A very able manipulative mathematician, Fisher enjoys a real mastery
in evaluating complicated multiple integrals.")

texts <- cleanTexts(text=texts)
makeWordlist(text=texts, k = 2L)

tosca documentation built on Oct. 28, 2021, 5:07 p.m.