# Text Classification in R [closed]

New to R, and am trying to do text classification. I am using R package tm to convert raw txt data into matrix. Here's the relevant code snippet.

 col <- Corpus(DirSource(path),
language = "en",

tdm <-  TermDocumentMatrix(col, control = list(tokenize = NGramTokenizer))


I have the following questions:

1) Feature selection

I need to do chi-squared or information gain based feature selection on my data. Which R packages can I look at? I came across at caret and boruta but they do not seem to be appropriate for what I am wanting to do.

2) Handling new (unseen) instances

Let's say I have trained my model using my training set. When the test set comes in, I would need to pass it through same filters (stemming, stopword removal, tf-idf weighting, feature selection etc.). I have no idea how to do this !

Any hint/help will be much appreciated.

## closed as not a real question by user88 Jul 31 '11 at 14:12

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. If this question can be reworded to fit the rules in the help center, please edit the question.

• There is an answer already, so I'll close it for now so user4581 had a chance to access his answer when possibly answering your new questions. Then it will be deleted as you asked. – user88 Jul 31 '11 at 14:15