Text Mining Package

Text Mining Package [R logo]

Help pages for package `tm' version 0.1-1

A C D E F G H I L M N O P R S T U W X misc

%IN% | Methods for Function %IN% in Package `textmin'
%IN%,TextDocument,TextDocCol-method | Methods for Function %IN% in Package `textmin'
%IN%-methods | Methods for Function %IN% in Package `textmin'

-- A --

acq | 50 exemplary news articles from the Reuters-21578 XML data set of topic acq
appendElem | Methods for Function appendElem in Package `textmin'
appendElem,TextDocCol,TextDocument-method | Methods for Function appendElem in Package `textmin'
appendElem,TextRepository,TextDocCol-method | Methods for Function appendElem in Package `textmin'
appendElem-methods | Methods for Function appendElem in Package `textmin'
appendMeta | Methods for Function appendMeta in Package `textmin'
appendMeta,TextDocCol-method | Methods for Function appendMeta in Package `textmin'
appendMeta,TextRepository-method | Methods for Function appendMeta in Package `textmin'
appendMeta-methods | Methods for Function appendMeta in Package `textmin'
asPlain | Methods for Function asPlain in Package `textmin'
asPlain,PlainTextDocument,ANY-method | Methods for Function asPlain in Package `textmin'
asPlain,XMLTextDocument,function-method | Methods for Function asPlain in Package `textmin'
asPlain-methods | Methods for Function asPlain in Package `textmin'
Author | Text document
Author,TextDocument-method | Text document
Author<-,TextDocument-method | Text document

-- C --

c,TextDocCol-method | Methods for Function c in Package `textmin'
c,TextDocument-method | Methods for Function c in Package `textmin'
c-methods | Methods for Function c in Package `textmin'
Cached | Text document
Cached,NewsgroupDocument-method | Text document
Cached,PlainTextDocument-method | Text document
Cached,XMLTextDocument-method | Text document
Cached<-,NewsgroupDocument-method | Text document
Cached<-,PlainTextDocument-method | Text document
Cached<-,XMLTextDocument-method | Text document
CMetaData | Text document collection
CMetaData,TextDocCol-method | Text document collection
convertMboxEml | Convert E-Mails From mbox Format To eml Format
convertRCV1Plain | Transform A RCV1 Document To A Plain Text Document
convertReut21578XMLPlain | Transform A Reuters21578 XML Document To A Plain Text Document
Corpus | Text document
Corpus,NewsgroupDocument-method | Text document
Corpus,PlainTextDocument-method | Text document
Corpus,XMLTextDocument-method | Text document
Corpus<-,NewsgroupDocument-method | Text document
Corpus<-,PlainTextDocument-method | Text document
Corpus<-,XMLTextDocument-method | Text document
crude | 20 exemplary news articles from the Reuters-21578 XML data set of topic crude
CSVSource | Comma Seperated Value Source
CSVSource,ANY-method | Comma Seperated Value Source
CSVSource,character-method | Comma Seperated Value Source
CSVSource-class | Source for Comma Separated Files

-- D --

DateTimeStamp | Text document
DateTimeStamp,TextDocument-method | Text document
DateTimeStamp<-,TextDocument-method | Text document
Description | Text document
Description,TextDocument-method | Text document
Description<-,TextDocument-method | Text document
DirSource | Directory Source
DirSource,character-method | Directory Source
DirSource-class | Source for Directories
dissimilarity | Methods for Function dissimilarity in Package `textmin'
dissimilarity,TermDocMatrix,ANY,character-method | Methods for Function dissimilarity in Package `textmin'
dissimilarity,TextDocument,TextDocument,character-method | Methods for Function dissimilarity in Package `textmin'
dissimilarity-methods | Methods for Function dissimilarity in Package `textmin'
DMetaData | Text document collection
DMetaData,TextDocCol-method | Text document collection

-- E --

eoi | Methods for Function eoi in Package `textmin'
eoi,CSVSource-method | Methods for Function eoi in Package `textmin'
eoi,DirSource-method | Methods for Function eoi in Package `textmin'
eoi,GmaneSource-method | Methods for Function eoi in Package `textmin'
eoi,ReutersSource-method | Methods for Function eoi in Package `textmin'
eoi-methods | Methods for Function eoi in Package `textmin'

-- F --

findAssocs | Methods for Function findAssocs in Package `textmin'
findAssocs,matrix,character-method | Methods for Function findAssocs in Package `textmin'
findAssocs,TermDocMatrix,character-method | Methods for Function findAssocs in Package `textmin'
findAssocs-methods | Methods for Function findAssocs in Package `textmin'
findFreqTerms | Methods for Function findFreqTerms in Package `textmin'
findFreqTerms,TermDocMatrix,numeric,numeric-method | Methods for Function findFreqTerms in Package `textmin'
findFreqTerms-methods | Methods for Function findFreqTerms in Package `textmin'

-- G --

getElem | Methods for Function getElem in Package `textmin'
getElem,CSVSource-method | Methods for Function getElem in Package `textmin'
getElem,DirSource-method | Methods for Function getElem in Package `textmin'
getElem,GmaneSource-method | Methods for Function getElem in Package `textmin'
getElem,ReutersSource-method | Methods for Function getElem in Package `textmin'
getElem-methods | Methods for Function getElem in Package `textmin'
GmaneSource | Gmane Source
GmaneSource,ANY-method | Gmane Source
GmaneSource,character-method | Gmane Source
GmaneSource-class | Source for Gmane Feeds

-- H --

Heading | Text document
Heading,TextDocument-method | Text document
Heading<-,TextDocument-method | Text document

-- I --

ID | Text document
ID,TextDocument-method | Text document
ID<-,TextDocument-method | Text document
inspect | Methods for Function inspect in Package `textmin'
inspect,TextDocCol-method | Methods for Function inspect in Package `textmin'
inspect-methods | Methods for Function inspect in Package `textmin'

-- L --

length | Methods for Function length in Package `textmin'
length,TextDocCol-method | Methods for Function length in Package `textmin'
length,TextRepository-method | Methods for Function length in Package `textmin'
length-methods | Methods for Function length in Package `textmin'
loadDoc | Methods for Function loadDoc in Package `textmin'
loadDoc,NewsgroupDocument-method | Methods for Function loadDoc in Package `textmin'
loadDoc,PlainTextDocument-method | Methods for Function loadDoc in Package `textmin'
loadDoc,XMLTextDocument-method | Methods for Function loadDoc in Package `textmin'
loadDoc-methods | Methods for Function loadDoc in Package `textmin'
LocalMetaData | Text document
LocalMetaData,TextDocument-method | Text document

-- M --

MetaDataNode-class Metadata Node

-- N --

NewsgroupDocument-class Text document

-- O --

Origin | Text document
Origin,TextDocument-method | Text document
Origin<-,TextDocument-method | Text document

-- P --

PlainTextDocument-class | Text document
preprocessReut21578XML | Preprocess the Reuters21578 XML archive.
prescindMeta | Methods for Function prescindMetadata in Package `textmin'
prescindMeta,TextDocCol,character-method | Methods for Function prescindMetadata in Package `textmin'
prescindMeta-methods | Methods for Function prescindMetadata in Package `textmin'

-- R --

readGmane | Read In A Newsgroup Document
readNewsgroup | Read In A Newsgroup Document
readPlain | Read In A Text Document
readRCV1 | Read In A Reuters Corpus Volume 1 Document
readReut21578XML | Read In A Reuters21578 XML Document
removeMeta | Methods for Function removeMeta in Package `textmin'
removeMeta,TextDocCol-method | Methods for Function removeMeta in Package `textmin'
removeMeta,TextRepository-method | Methods for Function removeMeta in Package `textmin'
removeMeta-methods | Methods for Function removeMeta in Package `textmin'
removeWords | Methods for Function removeWords in Package `textmin'
removeWords,PlainTextDocument,character-method | Methods for Function removeWords in Package `textmin'
removeWords-methods | Methods for Function removeWords in Package `textmin'
RepoMetaData | Text document collection
RepoMetaData,TextRepository-method | Text document collection
ReutersSource | Reuters Source
ReutersSource,ANY-method | Reuters Source
ReutersSource,character-method | Reuters Source
ReutersSource-class | Source for Reuters Files

-- S --

searchFullText | Methods for Function searchFullText in Package `textmin'
searchFullText,PlainTextDocument,character-method | Methods for Function searchFullText in Package `textmin'
searchFullText-methods | Methods for Function searchFullText in Package `textmin'
sFilter | Statement Filter
show,TextDocCol-method | Methods for Function show in Package `textmin'
show,TextRepository-method | Methods for Function show in Package `textmin'
show-methods | Methods for Function show in Package `textmin'
Source-class | Source Manager
stemDoc | Methods for Function stemDoc in Package `textmin'
stemDoc,PlainTextDocument-method | Methods for Function stemDoc in Package `textmin'
stemDoc-methods | Methods for Function stemDoc in Package `textmin'
stepNext | Methods for Function stepNext in Package `textmin'
stepNext,CSVSource-method | Methods for Function stepNext in Package `textmin'
stepNext,DirSource-method | Methods for Function stepNext in Package `textmin'
stepNext,GmaneSource-method | Methods for Function stepNext in Package `textmin'
stepNext,ReutersSource-method | Methods for Function stepNext in Package `textmin'
stepNext-methods | Methods for Function stepNext in Package `textmin'
stopwords_en | English Stopwords
stripWhitespace | Methods for Function stripWhitespace in Package `textmin'
stripWhitespace,PlainTextDocument-method | Methods for Function stripWhitespace in Package `textmin'
stripWhitespace-methods | Methods for Function stripWhitespace in Package `textmin'
summary,TextDocCol-method | Methods for Function summary in Package `textmin'
summary,TextRepository-method | Methods for Function summary in Package `textmin'
summary-methods | Methods for Function summary in Package `textmin'

-- T --

TermDocMatrix | Term-document matrix
TermDocMatrix,TextDocCol-method | Term-document matrix
TermDocMatrix-class | Term-document matrix
TextDocCol | Text document collection
TextDocCol,Source-method | Text document collection
TextDocCol-class | Text document collection
TextDocument-class | Text document
TextRepository | Text document collection
TextRepository,TextDocCol-method | Text document collection
TextRepository-class | Text document collection
tmFilter | Methods for Function tmFilter in Package `textmin'
tmFilter,TextDocCol-method | Methods for Function tmFilter in Package `textmin'
tmFilter-methods | Methods for Function tmFilter in Package `textmin'
tmIndex | Methods for Function tmIndex in Package `textmin'
tmIndex,TextDocCol-method | Methods for Function tmIndex in Package `textmin'
tmIndex-methods | Methods for Function tmIndex in Package `textmin'
tmMap | Methods for Function tmMap in Package `textmin'
tmMap,TextDocCol,function-method | Methods for Function tmMap in Package `textmin'
tmMap-methods | Methods for Function tmMap in Package `textmin'
tmTolower | Methods for Function tmTolower in Package `textmin'
tmTolower,PlainTextDocument-method | Methods for Function tmTolower in Package `textmin'
tmTolower-methods | Methods for Function tmTolower in Package `textmin'
tmUpdate | Methods for Function tmUpdate in Package `textmin'
tmUpdate,TextDocCol,DirSource-method | Methods for Function tmUpdate in Package `textmin'
tmUpdate-methods | Methods for Function tmUpdate in Package `textmin'

-- U --

URI | Text document
URI,NewsgroupDocument-method | Text document
URI,PlainTextDocument-method | Text document
URI,XMLTextDocument-method | Text document

-- W --

Weighting | Term-document matrix
Weighting,TermDocMatrix-method | Term-document matrix
Weighting<-,TermDocMatrix-method | Term-document matrix

-- X --

XMLTextDocument-class Text document

-- misc --

[,TextDocCol-method | Methods for Subset Functions in Package `textmin'
[-methods | Methods for Subset Functions in Package `textmin'
[<-,TextDocCol-method | Methods for Subset Functions in Package `textmin'
[<--methods | Methods for Subset Functions in Package `textmin'
[[,TextDocCol-method | Methods for Subset Functions in Package `textmin'
[[-methods | Methods for Subset Functions in Package `textmin'
[[<-,TextDocCol-method | Methods for Subset Functions in Package `textmin'
[[<--methods | Methods for Subset Functions in Package `textmin'


50 exemplary news articles from the Reuters-21578 XML data set of topic acq

Description

This dataset holds 50 news articles with additional meta information from the Reuters-21578 XML data set. All documents belong to the topic acq.

Usage

data(acq)

Format

A text document collection of 50 text documents.

Source

Reuters-21578 Text Categorization Collection Distribution 1.0 (XML format)

References

Lewis, David (1997) Reuters-21578 Text Categorization Collection Distribution 1.0. http://kdd.ics.uci.edu/databases/reuters21578/reuters21578.html

[Package tm version 0.1-1 Index]


Methods for Function appendElem in Package 'textmin'

Description

Methods for function appendElem in Package `textmin'

Methods

object = "TextDocCol", data = "TextDocument", meta = NULL
Returns a text document collection where the data text document is added to the data slot of the object text document collection. Optionally meta data (DMetaData) can be added with meta to the document collection.
object = "TextRepository", data = "TextDocCol", meta = NULL
Returns a text repository where the data text document collection is added to the data slot of the object text repository. Optionally meta data can be added with meta to the repository.

See Also

DMetaData RepoMetaData


Methods for Function appendMeta in Package 'textmin'

Description

Methods for function appendMeta in Package `textmin'

Methods

object = "TextDocCol", cmeta = NULL, dmeta = NULL
Returns a text document collection where the cmeta is added to the CMetaData and dmeta is added to the DMetaData.
object = "TextRepository", cmeta = NULL, dmeta = NULL
Returns a text repository where cmeta is added to the metadata slot of the object text repository.

See Also

DMetaData CMetaData RepoMetaData


Methods for Function asPlain in Package 'textmin'

Description

Methods for function asPlain in Package `textmin'

Methods

object = "PlainTextDocument"
Returns object.
object = "XMLTextDocument", FUN
Converts object to a PlainTextDocument by applying FUN on the XML root node and returns the new object.

See Also

convertReut21578XMLPlain convertRCV1Plain


Methods for Function c in Package 'textmin'

Description

Methods for function c in Package `textmin'

Methods

x = "TextDocCol"
concatenates several text document collections to a single one.
x = "TextDocument"
concatenates several text documents to a single text document collection.


Convert E-Mails From mbox Format To eml Format

Description

Convert e-mails from mbox (i.e., several mails in a single box) format to eml (i.e., every mail in a single file) format.

Usage

convertMboxEml(mbox, eml.dir)

Arguments

mbox | a character describing the mbox location.
eml.dir | a character describing the output directory.

Value

No explicit return value. As a side product the directory eml.dir contains the e-mails.

Author(s)

Ingo Feinerer


Transform A RCV1 Document To A Plain Text Document

Description

Transform a Reuters Corpus Volume 1 XML document to a plain text document.

Usage

convertRCV1Plain(node, ...)

Arguments

node | an XML node representing a <newsitem></newsitem> element from a well-formed RCV1 XML file.
... | Arguments passed over by calling functions.

Value

A PlainTextDocument representing node.

Author(s)

Ingo Feinerer

See Also

asPlain


Transform A Reuters21578 XML Document To A Plain Text Document

Description

Transform a Reuters21578 XML document to a plain text document.

Usage

convertReut21578XMLPlain(node, ...)

Arguments

node | an XML node representing a <REUTERS></REUTERS> element from a well-formed Reuters-21578 XML file.
... | Arguments passed over by calling functions.

Value

A PlainTextDocument representing node.

Author(s)

Ingo Feinerer

See Also

asPlain


20 exemplary news articles from the Reuters-21578 XML data set of topic crude

Description

This data set holds 20 news articles with additional meta information from the Reuters-21578 XML data set. All documents belong to the topic crude.

Usage

data(crude)

Format

A text document collection of 20 text documents.

Source

Reuters-21578 Text Categorization Collection Distribution 1.0 (XML format)

References

Lewis, David (1997) Reuters-21578 Text Categorization Collection Distribution 1.0. http://kdd.ics.uci.edu/databases/reuters21578/reuters21578.html


Comma Seperated Value Source

Description

Constructs a source for a comma separated values file.

Usage

## S4 method for signature 'character':
CSVSource(object)

Arguments

object either a character identifying the file or a call which results in a connection.

Value

An S4 object of class CSVSource which extends the class Source representing a comma separated values file.

Author(s)

Ingo Feinerer


Source for Comma Separated Files

Description

A class representing a comma separated file, where each line stands for a text document.

Objects from the Class

Objects can be created by calls of the form new("CSVSource", ...).

Slots

URI:
Object of class character describing the connection call to be made for accessing the document physically
Content:
Object of class character holding the CSV file corpus
LoDSupport:
Object of class "logical" indicating Load on Demand Support
Position:
Object of class "numeric" giving the position in the source

Extends

Class Source, directly.

Author(s)

Ingo Feinerer


Directory Source

Description

Constructs a directory source.

Usage

## S4 method for signature 'character':
DirSource(directory, recursive = FALSE)

Arguments

directory | a directory.
recursive | a logical value indicating whether the directory should be traversed recursively.

Value

An S4 object of class DirSource which extends the class Source representing a directory.

Author(s)

Ingo Feinerer


Source for Directories

Description

A class representing a directory. Each file in this directory is considered to be a document.

Objects from the Class

Objects can be created by calls of the form new("DirSource", ...).

Slots

FileList:
Object of class character giving the filelist in the directory
LoDSupport:
Object of class "logical" indicating Load on Demand Support
Position:
Object of class "numeric" giving the position in the source

Extends

Class Source, directly.

Author(s)

Ingo Feinerer


Methods for Function dissimilarity in Package 'textmin'

Description

Methods for function dissimilarity in Package `textmin'

Methods

x = "TermDocMatrix", y = "ANY", method = "character"
Computes the dissimilarity between the documents in x with the distance measure method. Available methods are:
  • cosine Cosine Measure
  • pearson Pearson Measure
  • extjacc Extended Jaccardi Measure

Formally the dissimilarity is returned in form of a dist object.

x = "TextDocument", y = "TextDocument", method = "character"
Computes the dissimilarity between x and y with the distance measure method. Available methods are:
  • cosine Cosine Measure
  • pearson Pearson Measure
  • extjacc Extended Jaccardi Measure


Methods for Function eoi in Package 'textmin'

Description

Methods for function eoi in Package `textmin'.

Methods

object = "DirSource"
returns TRUE if the last item has been reached.
object = "CSVSource"
returns TRUE if the last item has been reached.
object = "ReutersSource"
returns TRUE if the last item has been reached.
object = "GmaneSource"
returns TRUE if the last item has been reached.


Methods for Function findAssocs in Package 'textmin'

Description

Methods for function findAssocs in Package `textmin'

Methods

object = "TermDocMatrix", term = "character", corlimit
finds those terms from object which correlate with term more than corlimit
object = "matrix", term = "character", corlimit
finds those terms from the correlation matrix object which correlate with term more than corlimit


Methods for Function findFreqTerms in Package 'textmin'

Description

Methods for function findFreqTerms in Package `textmin'

Methods

object = "TermDocMatrix", lowfreq = "numeric", highfreq = "numeric"
Return those terms from object which occur more or equal often than lowfreq times and less or equal often than highfreq times.


Methods for Function getElem in Package 'textmin'

Description

Methods for function getElem in Package `textmin'.

Methods

object = "DirSource"
returns the element at current position from the source.
object = "CSVSource"
returns the element at current position from the source.
object = "ReutersSource"
returns the element at current position from the source.
object = "GmaneSource"
returns the element at current position from the source.


Gmane Source

Description

Constructs a source for a Gmane mailing list RSS feed.

Usage

## S4 method for signature 'character':
GmaneSource(object)

Arguments

object either a character identifying the file or a call which results in a connection.

Value

An S4 object of class GmaneSource which extends the class Source representing a Gmane mailing list RSS feed.

Author(s)

Ingo Feinerer


Source for Gmane Feeds

Description

A class representing a Gmane RSS feed.

Objects from the Class

Objects can be created by calls of the form new("GmaneSource", ...).

Slots

URI:
Object of class character describing the connection call to be made for accessing the document physically
Content:
Object of class character holding the RSS feed
LoDSupport:
Object of class "logical" indicating Load on Demand Support
Position:
Object of class "numeric" giving the position in the source

Extends

Class Source, directly.

Author(s)

Ingo Feinerer


Methods for Function %IN% in Package 'textmin'

Description

Methods for function %IN% in Package `textmin'

Methods

x = "TextDocument", y = "TextDocCol"
Returns TRUE if x occurs in y.


Methods for Function inspect in Package 'textmin'

Description

Methods for function inspect in Package `textmin'

Methods

object = "TextDocCol"
Displays detailed information for object, i.e., it prints all text documents and metadata.


Methods for Function length in Package 'textmin'

Description

Methods for function length in Package `textmin'

Methods

x = "TextDocCol"
Returns the number of text documents in x.
x = "TextRepository"
Returns the number of text document collections in x.


Methods for Function loadDoc in Package 'textmin'

Description

Methods for function loadDoc in Package `textmin'

Methods

object = "PlainTextDocument"
Loads the text corpus of object from disk into memory and return the new object.
object = "XMLTextDocument"
Loads the text corpus of object from disk into memory and return the new object.
object = "NewsgroupDocument"
Loads the text corpus of object from disk into memory and return the new object.


Metadata Node

Description

A class representing a node in the metadata tree of a text document collection.

Objects from the Class

Objects can be created by calls of the form new("MetaDataNode",...).

Slots

NodeID:
Object of class "numeric" containing a unique identification number for the node.
MetaData:
Object of class "list" containing meta data at node level.
children:
Object of class "list" containing either zero, one or two MetaDataNodes resulting in a binary tree.

Author(s)

Ingo Feinerer


Text document

Description

A class representing a newsgroup document with additional information. The newsgroup documents must be formatted according to the Newsgroup dataset from the UCI KDD archive.

Objects from the Class

Objects can be created by calls of the form new("NewsgroupDocument", ...).

Slots

Newsgroup:
Object of class character containing the newsgroups where the document has been posted
URI:
Object of class character containing the path and filename holding the data physically on disk
Cached:
Object of class numeric containing the status whether the file was already loaded in memory. Zero indicates not loaded, a value greater zero indicates in memory.

Extends

Class character and TextDocument, directly.

Methods

Corpus
signature(object = "NewsgroupDocument"): returns the text corpus, i.e., the actual character data slot
Corpus<-
signature(object = "NewsgroupDocument"): sets the text corpus, i.e., the actual character data slot
URI
signature(object = "NewsgroupDocument"): returns the filename on disk
Cached
signature(object = "NewsgroupDocument"): returns status information for loading on demand
Cached<-
signature(object = "NewsgroupDocument"): sets status information for loading on demand

Author(s)

Ingo Feinerer

References

http://kdd.ics.uci.edu/databases/20newsgroups/20newsgroups.html


Text document

Description

A class representing a plain text document with additional information.

Objects from the Class

Objects can be created by calls of the form new("PlainTextDocument", ...).

Slots

URI:
Object of class character containing the path and filename holding the data physically on disk
Cached:
Object of class numeric containing the status whether the file was already loaded in memory. Zero indicates not loaded, a value greater zero indicates in memory.

Extends

Class character and TextDocument, directly.

Methods

Corpus
signature(object = "PlainTextDocument"): returns the text corpus, i.e., the actual character data slot
Corpus<-
signature(object = "PlainTextDocument"): sets the text corpus, i.e., the actual character data slot
URI
signature(object = "PlainTextDocument"): returns the filename on disk
Cached
signature(object = "PlainTextDocument"): returns status information for loading on demand
Cached<-
signature(object = "PlainTextDocument"): sets status information for loading on demand

Author(s)

Ingo Feinerer


Preprocess the Reuters21578 XML archive.

Description

Preprocess the Reuters21578 XML archive by correcting invalid UTF8 encoding and copying each text document into a separate file.

Usage

preprocessReut21578XML(reuters.dir, reuters.oapf.dir, fix.enc = TRUE)

Arguments

reuters.dir | a character describing the input directory.
reuters.oapf.dir | a character describing the output directory.
fix.enc | a logical value indicating whether the invalid UTF8 encoding in the Reuters21578 XML dataset should be corrected.

Value

No explicit return value. As a side product the directory reuters.oapf.dir contains the corrected dataset.

Author(s)

Ingo Feinerer

References

Lewis, David (1997) Reuters-21578 Text Categorization Collection Distribution 1.0. http://kdd.ics.uci.edu/databases/reuters21578/reuters21578.html

Luz, Saturnino XML-encoded version of Reuters-21578. http://modnlp.berlios.de/reuters21578.html


Methods for Function prescindMetadata in Package 'textmin'

Description

Methods for function prescindMeta in Package `textmin'

Methods

object = "TextDocCol", meta = "character"
Copies the meta data from document slots or (local) document metadata of all documents in object to the (global) DMetaData data frame of object and returns the whole collection.

See Also

DMetaData


Read In A Newsgroup Document

Description

Returns a function which reads in a RSS feed as returned by Gmane for mailing lists.

Usage

readGmane(...)

Arguments

... arguments for the generator function.

Details

Formally this function is a function generator, i.e., it returns a function (which reads in a RSS feed) with a well-defined signature, but can access passed over arguments via lexical scoping. This is especially useful for reader functions for complex data structures which need a lot of configuration options.

Value

A function with the signature elem, load, id:

elem | A list with the two named elements content and uri. The first element must hold the document corpus to be read in, the second element must hold a call to the document corpus. The call is evaluated upon a request for load on demand.
load | A logical value indicating whether the document corpus should be immediately loaded into memory.
id | A character representing a unique identification string for the returned text document.

normal-bracket23bracket-normal
The function returns a NewsgroupDocument representing content.

Author(s)

Ingo Feinerer


Read In A Newsgroup Document

Description

Returns a function which reads in a newsgroup document as found in the UCI KDD Newsgroup Dataset.

Usage

readNewsgroup(...)

Arguments

... arguments for the generator function.

Details

Formally this function is a function generator, i.e., it returns a function (which reads in a newsgroup document) with a well-defined signature, but can access passed over arguments via lexical scoping. This is especially useful for reader functions for complex data structures which need a lot of configuration options.

Value

A function with the signature elem, load, id:

elem | A list with the two named elements content and uri. The first element must hold the document corpus to be read in, the second element must hold a call to the document corpus. The call is evaluated upon a request for load on demand.
load | A logical value indicating whether the document corpus should be immediately loaded into memory.
id | A character representing a unique identification string for the returned text document.

normal-bracket25bracket-normal
The function returns a NewsgroupDocument representing content.

Author(s)

Ingo Feinerer


Read In A Text Document

Description

Returns a function which reads in a text document without knowledge about its internal structure and possible available metadata.

Usage

readPlain(...)

Arguments

... arguments for the generator function.

Details

Formally this function is a function generator, i.e., it returns a function (which reads in a text document) with a well-defined signature, but can access passed over arguments via lexical scoping. This is especially useful for reader functions for complex data structures which need a lot of configuration options.

Value

A function with the signature elem, load, id:

elem | A list with the two named elements content and uri. The first element must hold the document corpus to be read in, the second element must hold a call to the document corpus. The call is evaluated upon a request for load on demand.
load | A logical value indicating whether the document corpus should be immediately loaded into memory.
id | A character representing a unique identification string for the returned text document.

normal-bracket23bracket-normal
The function returns a PlainTextDocument representing content.

Author(s)

Ingo Feinerer


Read In A Reuters Corpus Volume 1 Document

Description

Returns a function which reads in a Reuters Corpus Volume 1 XML document.

Usage

readRCV1(...)

Arguments

... arguments for the generator function.

Details

Formally this function is a function generator, i.e., it returns a function (which reads in a Reuters Corpus Volume 1 XML document) with a well-defined signature, but can access passed over arguments via lexical scoping. This is especially useful for reader functions for complex data structures which need a lot of configuration options.

Value

A function with the signature elem, load, id:

elem | A list with the two named elements content and uri. The first element must hold the document corpus to be read in, the second element must hold a call to the document corpus. The call is evaluated upon a request for load on demand.
load | A logical value indicating whether the document corpus should be immediately loaded into memory.
id | A character representing a unique identification string for the returned text document.

normal-bracket23bracket-normal
The function returns a XMLTextDocument representing content.

Author(s)

Ingo Feinerer


Read In A Reuters21578 XML Document

Description

Returns a function which reads in a Reuters21578 XML document.

Usage

readReut21578XML(...)

Arguments

... arguments for the generator function.

Details

Formally this function is a function generator, i.e., it returns a function (which reads in a Reuters21578 XML document) with a well-defined signature, but can access passed over arguments via lexical scoping. This is especially useful for reader functions for complex data structures which need a lot of configuration options.

Value

A function with the signature elem, load, id:

elem | A list with the two named elements content and uri. The first element must hold the document corpus to be read in, the second element must hold a call to the document corpus. The call is evaluated upon a request for load on demand.
load | A logical value indicating whether the document corpus should be immediately loaded into memory.
id | A character representing a unique identification string for the returned text document.

normal-bracket23bracket-normal
The function returns a XMLTextDocument representing content.

Author(s)

Ingo Feinerer


Methods for Function removeMeta in Package 'textmin'

Description

Methods for function removeMeta in Package `textmin'

Methods

object = "TextDocCol", cmeta = NULL, dmeta = NULL
Returns a text document collection where the cmeta is removed from the CMetaData and dmeta is removed from the DMetaData.
object = "TextRepository", cmeta = NULL, dmeta = NULL
Returns a text repository where cmeta is removed from the metadata slot of the object text repository.

See Also

DMetaData CMetaData RepoMetaData


Methods for Function removeWords in Package 'textmin'

Description

Methods for function removeWords in Package `textmin'

Methods

object = "PlainTextDocument", stopwords = "character"
Removes all words which occur in stopwords from object and return the object.


Reuters Source

Description

Constructs a source for a Reuters XML document.

Usage

## S4 method for signature 'character':
ReutersSource(object)

Arguments

object either a character identifying the file or a call which results in a connection.

Value

An S4 object of class ReutersSource which extends the class Source representing a Reuters XML document.

Author(s)

Ingo Feinerer


Source for Reuters Files

Description

A class representing either a Reuters21578 or RCV1 source, where several documents are found in a single source (i.e., typically file).

Objects from the Class

Objects can be created by calls of the form new("ReutersSource", ...).

Slots

URI:
Object of class character describing the connection call to be made for accessing the document physically
Content:
Object of class list holding the Reuters XML source corpus
LoDSupport:
Object of class "logical" indicating Load on Demand Support
Position:
Object of class "numeric" giving the position in the source

Extends

Class Source, directly.

Author(s)

Ingo Feinerer


Methods for Function searchFullText in Package 'textmin'

Description

Methods for function searchFullText in Package `textmin'

Methods

object = "PlainTextDocument", pattern = "character"
return TRUE if the regular expression pattern matches object's text corpus.


Statement Filter

Description

Filter metadata by special statements.

Usage

sFilter(object, s, ...)

Arguments

object | a TextDocCol to be the filter applied to.
s | a statement of format "tag1 = 'expr1' & tag2 = 'expr2' & ...".
... | arguments passed over by calling functions.

Details

The statement s models a simple query language. It consists of an expression as passed over to a data frame for subsetting. Tags in s represent metadata variables. Variables only available at document level are shifted up to the data frame if necessary. Note that the metadata tags for the slots Author, DateTimeStamp, Description, ID, Origin and Heading are author, datetimestamp, description, identifier, origin and heading, respectively, to avoid name conflicts.

Value

A Boolean vector to represent the subset of the DMetaData (extended for shifted up variables) data frame as specified by the statement.

Author(s)

Ingo Feinerer

Examples

## Load example dataset
data(crude)

## Statement Filter returning TRUE for document with ID 127 and heading DIAMOND ...
sFilter(crude, "identifier == '127' & heading == 'DIAMOND SHAMROCK (DIA) CUTS CRUDE PRICES'")


Methods for Function show in Package 'textmin'

Description

Methods for function show in Package `textmin'

Methods

object = "TextDocCol"
Prints a short description of object.
object = "TextRepository"
Prints a short description of object.


Source Manager

Description

A class representing a source, e.g. a directory, a connection, et cetera.

Objects from the Class

Objects can be created by calls of the form new("Source", ...).

Slots

LoDSupport:
Object of class logical indicating where this source supports load on demand
Position:
Object of class numeric indicating the position in the source

Author(s)

Ingo Feinerer


Methods for Function stemDoc in Package 'textmin'

Description

Methods for function stemDoc in Package `textmin'

Methods

object = "PlainTextDocument"
Stems the corpus from object with Porter's stemming algorithm.


Methods for Function stepNext in Package 'textmin'

Description

Methods for function stepNext in Package `textmin'.

Methods

object = "DirSource"
jumps to the next element in the source.
object = "CSVSource"
jumps to the next element in the source.
object = "ReutersSource"
jumps to the next element in the source.
object = "GmaneSource"
jumps to the next element in the source.


English Stopwords

Description

This dataset contains very common words that typically want to be ignored when processing text.

Usage

   data(stopwords_en)

Format

A character vector containing 424 English stopwords.


Methods for Function stripWhitespace in Package 'textmin'

Description

Methods for function stripWhitespace in Package `textmin'

Methods

object = "PlainTextDocument", ...
Strips any unnecessary whitespace from object and return the object.


Methods for Subset Functions in Package 'textmin'

Description

Methods for subset functions [, [<-, [[ and [[<- in Package `textmin'.

Arguments

x = "TextDocCol" the text document collection to be subsetted or modified.


Methods for Function summary in Package 'textmin'

Description

Methods for function summary in Package `textmin'

Methods

object = "TextDocCol"
Prints a description including information on available metadata tags.
object = "TextRepository"
Prints a description including information on available metadata tags.


Term-document matrix

Description

Constructs a term-document matrix.

Usage

## S4 method for signature 'TextDocCol':
TermDocMatrix(object, weighting = "tf", stemming
= FALSE, language = "english", minWordLength = 3, minDocFreq = 1,
stopwords = NULL)

Arguments

object | a text document collection
weighting the weighting mode for the term-document matrix. Possible settings are
  • tf Term frequency
  • tf-idf Term frequency inverse document frequency
  • bin Binary frequency
  • logical Similar to binary frequency but with Boolean values
stemming | if set, stems words before making the term-document matrix.
language | the language determines the stemming rules
minWordLength | words smaller than this number are discarded for the term-document matrix.
minDocFreq | words that appear less often in documents than this number are discarded for the term-document matrix.
stopwords | a plain text file with all stopwords

Value

An S4 object of class TermDocMatrix which extends the class matrix containing a term-document matrix. The following slots contain useful information:

Weighting The weighting mode applied to the term-document matrix

Author(s)

Ingo Feinerer


Term-document matrix

Description

A class representing a term-document matrix. A column represents a term, and a row the ID of a text document, respectively.

Objects from the Class

Objects can be created by calls of the form new("TermDocMatrix",...) or by calling the function TermDocMatrix.

Slots

Weighting:
Object of class "character" containing the mode which was applied on the matrix. Possible are term frequency "tf", term frequency-inverse document frequency "tf-idf", binary "bin" and logical "logical".

Extends

Class "matrix", directly.

Methods

Weighting
signature(object = "TermDocMatrix"): returns the weighting mode
Weighting<-
signature(object = "TermDocMatrix"): sets the weighting mode

Author(s)

Ingo Feinerer

See Also

TermDocMatrix


Text document collection

Description

Constructs a text document collection.

Usage

## S4 method for signature 'Source':
TextDocCol(object, parser = read_plain, load = FALSE,...)

Arguments

object | a Source object.
parser | a parsing function capable of handling the file format found in object.
load | a logical value indicating whether the text corpus of documents should be loaded immediately into memory (load = TRUE) or loaded when necessary (load = FALSE). This allows to minimize memory demands for large document collections. If object does not support load on demand the text corpus is automatically loaded, i.e., this argument is overruled.
... | optional arguments for the parser.

Value

An S4 object of class TextDocCol which extends the class list containing a collection of text documents.

Author(s)

Ingo Feinerer


Text document collection

Description

A class representing a collection of text documents.

Objects from the Class

Objects can be created by calls of the form new("TextDocCol",...) or by calling the function TextDocCol.

Slots

CMetaData:
Object of class "MetaDataNode" containing the Document Collection specific MetaData for the collection in form of tag-value pairs and information about children in form of a binary tree. This information is useful for reconstructing meta data after e.g. merging document collections.
DMetaData:
Object of class "data.frame" containing the Document specific MetaData for the collection. This dataframe typically encompasses clustering or classification results which basically are metadata for documents but form an own entity (e.g., with its name, the value range, etc.).

Extends

Class "list", directly.

Methods

CMetaData
signature(object = "TextDocCol"): returns the document collection specific metadata in form of a tag-value paired list.
DMetaData
signature(object = "TextDocCol"): returns the document specific metadata in form of a data frame.

Author(s)

Ingo Feinerer

See Also

MetaDataNode-class TextDocCol


Text document

Description

A class representing a text document with additional information.

Objects from the Class

Objects can be created by calls of the form new("TextDocument", ...).

Slots

Author:
Object of class character containing the author names
DateTimeStamp:
Object of class character containing the date and time when the document was written
Description:
Object of class character containing additional text information
ID:
Object of class integer containing an identifier
Origin:
Object of class character containing information on the source and origin of the text
Heading:
Object of class character containing the title or a short heading
LocalMetaData:
Object of class list containing the local metadata in form of tag-value pairs

Methods

Author
signature(object = "TextDocument"): returns the author names
Author<-
signature(object = "TextDocument"): sets the author names
DateTimeStamp
signature(object = "TextDocument"): returns the date and time when the document was written
DateTimeStamp<-
signature(object = "TextDocument"): sets the date and time when the document was written
Description
signature(object = "TextDocument"): returns additional text information
Description<-
signature(object = "TextDocument"): sets additional text information
ID
signature(object = "TextDocument"): returns the identifier
ID<-
signature(object = "TextDocument"): sets the identifier
Origin
signature(object = "TextDocument"): returns information on the source and origin of the text
Origin<-
signature(object = "TextDocument"): sets information on the source and origin of the text
Heading
signature(object = "TextDocument"): returns the title or a short heading
Heading<-
signature(object = "TextDocument"): sets the title or a short heading
LocalMetaData
signature(object = "TextDocument"): returns the local metadata in form of a tag-value paired list

Author(s)

Ingo Feinerer


Text document collection

Description

Constructs a text document collection from various sources.

Usage

## S4 method for signature 'TextDocCol':
TextRepository(object, metaname = "created", meta = date())

Arguments

object | a directory containing the documents.
metaname | an initial tag for the representational metadata
meta | an initial value for the metaname tag

Value

An S4 object of class TextRepository which extends the class list containing text document collections.

Author(s)

Ingo Feinerer


Text document collection

Description

A class representing a repository of text document collections.

Objects from the Class

Objects can be created by calls of the form new("TextRepository",...) or by calling the function TextRepository.

Slots

RepresentationMetaData:
Object of class "list" containing representational metadata for the text document collections in form of tag-value pairs.

Extends

Class "list", directly.

Methods

RepresentationMetaData
signature(object = "TextRepository"): returns representational metadata in form of a tag-value paired list.

Author(s)

Ingo Feinerer

See Also

TextRepository


Builds a vector representation of a text document

Description

Builds a vector representation of a text document

[Package tm version 0.1-1 Index]


Internal tm Functions

Description

Internal tm functions

Details

These are not to be called by the user (or in some cases are just waiting for proper documentation to be written :).


Methods for Function tmFilter in Package 'textmin'

Description

Methods for function tmFilter in Package `textmin'

Methods

object = "TextDocCol", FUN = sFilter, doclevel = FALSE
If doclevel is set, the method applies FUN onto each element of object and returns the filtered object; otherwise FUN is applied to object itself, i.e., the filter is applied onto the object. Note that metadata is automatically passed to FUN. The function FUN must return a Boolean value.

See Also

sFilter tmIndex


Methods for Function tmIndex in Package 'textmin'

Description

Methods for function tmIndex in Package `textmin'

Methods

object = "TextDocCol", FUN = sFilter, doclevel = FALSE
If doclevel is set, the method applies FUN onto each element of object and returns the indices; otherwise FUN is applied to object itself. Note that metadata is automatically passed to FUN. The function FUN must return a Boolean value.

See Also

sFilter tmFilter


Methods for Function tmMap in Package 'textmin'

Description

Methods for function tmMap in Package `textmin'

Methods

object = "TextDocCol", FUN
Applies FUN onto each element of object. Note that document specific metadata (i.e., DMetaData(object) is automatically passed to FUN as argument DMetaData. FUN must be a function which returns a TextDocument.


Methods for Function tmTolower in Package 'textmin'

Description

Methods for function tmTolower in Package `textmin'

Methods

object = "PlainTextDocument", ...
Converts all words from object to lower case and return the object.


Methods for Function tmUpdate in Package 'textmin'

Description

Methods for function tmUpdate in Package `textmin'

Methods

object = "TextDocCol", origin = "DirSource", load = FALSE
Checks whether new documents are available in origin. If, object is updated, i.e., it is augmented with the newly available items. load specifies whether the new items should be loaded immediately into memory.


Weights a term-document matrix

Description

Weights a term-document matrix.


Text document

Description

A class representing an XML text document with additional information. The XML document itself is represented by an XMLDocument from the XML library.

Objects from the Class

Objects can be created by calls of the form new("XMLTextDocument", ...).

Slots

URI:
Object of class character containing the path and filename holding the data physically on disk
Cached:
Object of class numeric containing the status whether the file was already loaded in memory. Zero indicates not loaded, a value greater zero indicates in memory.

Extends

Class list and TextDocument, directly.

Methods

Corpus
signature(object = "XMLTextDocument"): returns the text corpus, i.e., the actual XMLDocument in the data slot
Corpus<-
signature(object = "XMLTextDocument"): sets the text corpus, i.e., the actual XMLDocument in data slot
URI
signature(object = "XMLTextDocument"): returns the filename on disk
Cached
signature(object = "XMLTextDocument"): returns status information for loading on demand
Cached<-
signature(object = "XMLTextDocument"): sets status information for loading on demand

Author(s)

Ingo Feinerer