[R] Reading .csv file under linux

David Scott d.scott at auckland.ac.nz
Tue Jan 22 23:05:09 CET 2008


I have encountered a problem with reading a .csv file on a linux box. I 
can read the file on my windows machine (under XP) but on the linux box it 
gives :

> patients <- read.csv("../Patients.csv", header = FALSE,
+                      col.names = patientsNames)
Error in type.convert(data[[i]], as.is = as.is[i], dec = dec,
na.strings = character(0)) :
   invalid multibyte string
Calls: read.csv -> read.table -> type.convert
Execution halted

I am running R 2.6.1 on both machines. I tried on another linux box 
running 2.5.1 and got the same problem

I am guessing it is something to do with the character encoding. On the 
linux box I have

LANG=en_US.UTF-8

Any advice would be welcome

David Scott


_________________________________________________________________
David Scott	Department of Statistics, Tamaki Campus
 		The University of Auckland, PB 92019
 		Auckland 1142,    NEW ZEALAND
Phone: +64 9 373 7599 ext 86830		Fax: +64 9 373 7000
Email:	d.scott at auckland.ac.nz

Graduate Officer, Department of Statistics
Director of Consulting, Department of Statistics



More information about the R-help mailing list