Learn R Programming

RTextTools (version 1.3.2)

matrix_container-class: an S4 class containing the training and classification matrices.

Description

An S4 class containing all information necessary to train, classify, and generate analytics for a dataset.

Arguments

Objects from the Class

Objects could in principle be created by calls of the form new("matrix_container", ...). The preferred form is to have them created via a call to create_corpus.

Examples

Run this code
library(RTextTools)
data <- read_data(system.file("data/NYTimes.csv.gz",package="RTextTools"),type="csv")
data <- data[sample(1:3100,size=100,replace=FALSE),]
matrix <- create_matrix(cbind(data$Title,data$Subject), language="english", 
removeNumbers=TRUE, stemWords=FALSE, weighting=weightTfIdf)
corpus <- create_corpus(matrix,data$Topic.Code,trainSize=1:75, testSize=76:100, 
virgin=FALSE)

corpus@training_matrix
corpus@training_codes
corpus@classification_matrix
corpus@testing_codes
corpus@column_names
corpus@virgin

Run the code above in your browser using DataLab