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

View source: R/mallet.R

mallet.read.dirR Documentation

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.

Value

a data.frame with file id and text content.

Note

This function was contributed to RMallet by Dan Bowen.

Author(s)

Dan Bowen

See Also

mallet.import

Examples

## Not run: 
directory <- system.file("stoplists", package = "mallet")
stoplists <- mallet.read.dir(directory)

## End(Not run)


mallet documentation built on July 20, 2022, 5:08 p.m.