Learn R Programming

mallet (version 1.0)

mallet.read.dir: Import documents from a directory into Mallet format

Description

This function takes a directory path as its only argument and returns a data.frame() with two columns: & , which can be passed to the mallet.import function. This data.frame() has as many rows as there are files in the Dir.

Usage

mallet.read.dir(Dir)

Arguments

Dir
The path to a directory containing one document per file.

See Also

mallet.import

Examples

Run this code
## Not run: 
# documents <- mallet.read.dir(Dir)
# mallet.instances <- mallet.import(documents$id, documents$text, "en.txt",
# 		    		token.regexp = "\\p{L}[\\p{L}\\p{P}]+\\p{L}")
# ## End(Not run)

Run the code above in your browser using DataLab