[R] A slight trap in read.table/read.csv.
Sharpie
chuck at sharpsteen.net
Sun Feb 28 23:23:25 CET 2010
Rolf Turner wrote:
>
> I solved the problem by putting in a colClasses argument in my
> call to read.csv(). But I really think that the read functions
> are being too clever by half here. If field entries are surrounded
> by quotes, shouldn't they be left as character? Even if they are
> all F's and T's?
>
It has been my experience that fields surrounded by quotes are interpreted
as factors unless the stringsAsFactors switch has been set to false. So it
seems the default behavior of read.table is to be clever. Annoying as these
behaviors are, changing them would probably break existing code that expects
the function to execute the way it does.
-Charlie
--
View this message in context: http://n4.nabble.com/A-slight-trap-in-read-table-read-csv-tp1573007p1573018.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list