[R] problems with read.table

Peter Holzer holzer at stat.math.ethz.ch
Wed Feb 10 10:06:29 CET 1999


Dear R users,
I have the following problem:
I have a table in ASCII-format, separated with commas. I can read it as
long as no field contains a comma itself. If one does, read.table doesn't
function even though that field is double-quoted.

Ex.:

File "test.csv":

Name,Strasse,PLZ
Jsaac,Gossauerstrassee 29,9100
Roth-Bernasconi,"20, ch. des Fauvettes",1212


adressen <- read.table("test.csv", header=T, sep=",")

results in an error as the comma in "20, ch. des Fauvettes" is interpreted
as a field delimiter. Playing around with read.table and also with scan I
found out that double-quotes are always interpreted as characters of their
own.

What can I do? Thanks for any help.

Peter
____________________________________________________________

Peter Holzer                      phone: + 41 1 632 46 34
Seminar fuer Statistik, SOL F7    fax:   + 41 1 632 10 86
(Sonneggstr. 33)                  <holzer at stat.math.ethz.ch>
ETH (Federal Inst. Technology)
8092 Zurich                       http://www.stat.math.ethz.ch/~holzer/
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list