Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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: <id> & <text>, 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.

Note

This function was contributed to RMallet by Dan Bowen.

See Also

Examples

## 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)

mallet

A wrapper around the Java machine learning tool MALLET

v1.0
MIT + file LICENSE
Authors
David Mimno
Initial release
2013-07-18

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.