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

From: Ben Bolker <bolker_at_ufl.edu>
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: 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.

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
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 https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive