Hi R-Users,
 
Thanks in advance.
 
I am using R-2.12.0 on Windows XP.
 
I am trying to produce an n X m matrix from text data stored in different files. Where n = number of words (say w1, w2, …, wn). M is the number of documents (say d1, d2, …, dm)
 
A. Using package tm
 
I am using package tm to do the job. I have provided the code below:
 
> my.corpus <- Corpus(DirSource(my.path), readerControl = list (reader=readPlain))
 
In readLines(y, encoding = x$Encoding) :
  incomplete final line found on 'M:\textmine/slr.txt'
 
> x <- TermDocMatrix(my.corpus) 
Error: could not find function "TermDocMatrix"
 
B. Using package(s) other than tm 
 
Once again, thank you very much for the time you have given.
 
Regards,
 
Deb
 
The code:
 
library(tm)
my.path<- 'M:\\textmine'
my.corpus <- Corpus(DirSource(my.path), readerControl = list (reader=readPlain)) 
x <- TermDocMatrix(my.corpus) 
x
 


      
	[[alternative HTML version deleted]]

