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

Ben Bolker bolker at ufl.edu
Thu Oct 29 21:37:29 CET 2009

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: http://www.nabble.com/Recommendation-for-dealing-with-mixed-input-types-in-CSV-tp26119243p26120294.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list