Learn R Programming

ngram (version 3.2.3)

rcorpus: Random Corpus

Description

Generate a corpus of random "words".

Usage

rcorpus(nwords = 50, alphabet = letters, minwordlen = 1, maxwordlen = 6)

Value

A string.

Arguments

nwords

Number of words to generate.

alphabet

The pool of "letters" that word generation coes from. By default, it is the lowercase roman alphabet.

minwordlen, maxwordlen

The min/max length of words in the generated corpus.

Examples

Run this code
rcorpus(10)

Run the code above in your browser using DataLab