[Rd] read.csv

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Sun, 14 Jun 2009 14:56:01 -0400


If read.csv's colClasses= argument is NOT used then read.csv accepts double quoted numerics:

  1. > read.csv(stdin())
  2. A,B
  3. "1",1
  4. "2",2 3: A B 1 1 1 2 2 2

However, if colClasses is used then it seems that it does not:

> read.csv(stdin(), colClasses = "numeric")

ink2">0: A,B
1: "1",1
2: "2",2
3:

Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, :   scan() expected 'a real', got '"1"'

Is this really intended? I would have expected that a csv file in which each field is surrounded with double quotes is acceptable in both cases. This may be documented as is yet seems undesirable from both a consistency viewpoint and the viewpoint that it should be possible to double quote fields in a csv file.



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sun 14 Jun 2009 - 19:00:57 GMT

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 Sun 14 Jun 2009 - 21:36:22 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive