[R] Problem reading non-ISO data via read.csv2

Gregor Gorjanc gregor.gorjanc at bfro.uni-lj.si
Tue Oct 24 10:41:11 CEST 2006


Hello!

I have a CSV file and when I try to import it into R with read.csv2 I
get the following error:

R> read.csv2(file="pasme2.csv", na.strings="")
Error in type.convert(data[[i]], as.is = as.is[i], dec = dec, na.strings
= character(0)) :
	invalid multibyte string

There are some "strange" characters in it, but I never experienced such
behaviour. Actually, this file was produced with R (2.4.0) on Windows!
Utility file under Linux says:

$ file pasme2.csv
pasme.csv: Non-ISO extended-ASCII text

I am attaching few lines of a file for example. And mandatory info:

R version 2.4.0 (2006-10-03)
i486-pc-linux-gnu

locale:
LC_CTYPE=en_GB.UTF-8;LC_NUMERIC=C;LC_TIME=en_GB.UTF-8;LC_COLLATE=en_GB.UTF-8;LC_MONETARY=en_GB.UTF-8;LC_MESSAGES=en_GB.UTF-8;LC_PAPER=en_GB.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_GB.UTF-8;LC_IDENTIFICATION=C

-- 
Lep pozdrav / With regards,
    Gregor Gorjanc
----------------------------------------------------------------------
University of Ljubljana     PhD student
Biotechnical Faculty
Zootechnical Department     URI: http://www.bfro.uni-lj.si/MR/ggorjan
Groblje 3                   mail: gregor.gorjanc <at> bfro.uni-lj.si

SI-1230 Domzale             tel: +386 (0)1 72 17 861
Slovenia, Europe            fax: +386 (0)1 72 17 888

----------------------------------------------------------------------
"One must learn by doing the thing; for though you think you know it,
 you have no certainty until you try." Sophocles ~ 450 B.C.
----------------------------------------------------------------------


More information about the R-help mailing list