Re: [R] Re commendation for dealing with mixed input types in CSV

From: Ben Bolker <>
Date: Thu, 29 Oct 2009 13:37:29 -0700 (PDT)

Jason Rupert wrote:
> Currently I have a CSV with mixed input types that I am trying to read in
> and reformat without having to list off all the column names.  Below is an
> example of the data:
> HouseColor, HouseSize, HouseCost
> Blue, 1600, 160e3
> Blue, 1600, 160e3
> [snip]

I'm a little surprised that read.csv is *not* automatically converting your scientific notation to numeric. When I save the three lines above to the file "house.tmp", I get numeric values ...

> read.csv("house.tmp",header=TRUE)

  HouseColor HouseSize HouseCost

1       Blue      1600    160000
2       Blue      1600    160000

  Are you sure there isn't something else funny about those columns?

View this message in context:
Sent from the R help mailing list archive at

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Thu 29 Oct 2009 - 20:44:00 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 Thu 29 Oct 2009 - 21:20:14 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive