Re: [R] DocumentTermMatrix error

From: Matev¾ Pavlič <>
Date: Sat, 21 May 2011 14:58:42 +0200

Got it...the problem was with Slovenian characters. Once i replaced them with normal characters it works fine.

Tnx anyway, m

-----Original Message-----
From: [] On Behalf Of Matev¾ Pavlič Sent: Saturday, May 21, 2011 1:27 PM
Subject: [R] DocumentTermMatrix error

Hi all,  

I have tried to create a DocumentTermMatrix with a tm package, but i get this error :  

Error in tolower(txt) :

  invalid input 'PROD Z LAHKO GNETNO MELJNO GLINO, ... in 'utf8towcs'  

I tried doing this as it is showed in : (An Introduction to Text Mining),  

with this R code :  


tekst <- Corpus(DirSource("."))

>Warning message:

>In readLines(y, encoding = x$Encoding) :

>incomplete final line found on './test.txt'

meta(tekst, "Heading", "local") <- c("test")


>Available meta data pairs are:

  Author :

   DateTimeStamp: 2011-05-21 11:25:21

   Description :

   Heading : test

  ID : test.txt

  Language : en

  Origin :  

test <- TermDocumentMatrix(tekst)

> Error in tolower(txt) :

> invalid input 'PROD Z LAHKO GNETNO MELJNO GLINO, ... in 'utf8towcs'

Attached is a small sample (test.txt) on which i worked.  

Any help would be appreaciated,

m mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Sat 21 May 2011 - 13:00:15 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 21 May 2011 - 13:20:09 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive