[R] Using read.table to read file created with read.table and qmethod = "escape"

Hadley Wickham hadley at rice.edu
Thu Apr 8 03:09:23 CEST 2010


df <- data.frame(a = "a\"b")
write.table(df, "test.csv", sep = ",", row = F)

Is there any to load test.csv into R correctly?  I've tried the following:

> read.table("test.csv", sep = ",")
[1] V1
<0 rows> (or 0-length row.names)
Warning message:
In read.table("test.csv", sep = ",") :
  incomplete final line found by readTableHeader on 'test.csv'
> read.table("test.csv", sep = ",", allowEscapes = T)
[1] V1
<0 rows> (or 0-length row.names)
Warning message:
In read.table("test.csv", sep = ",", allowEscapes = T) :
  incomplete final line found by readTableHeader on 'test.csv'

And I can't see any other options in read.table that would apply.

Regards,

Hadley


-- 
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/



More information about the R-help mailing list