Re: [R] Rodbc quesion: how to reliably determine the data type?

From: Albert-Jan Roskam <fomcl_at_yahoo.com>
Date: Tue, 03 May 2011 02:10:31 -0700 (PDT)

Hi Jeff,

Ah, thanks a lot! Yes, meanwhile I also switched to csv. This still requires knowledge about the regional settings (Sys.getlocale), but it's a lot more transparent.  

I'm quite new to R and I must say that stuff like this is eating up a LOT of my time. All those invisible data type conversions are driving me nuts. StringsAsFactors=F should be the default, for instance.

Cheers!!
Albert-Jan



All right, but apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, a fresh water system, and public health, what have the Romans ever done for us?


From: Jeff Newmiller <jdnewmil_at_dcn.davis.ca.us>

Sent: Tue, May 3, 2011 10:21:02 AM
Subject: Re: [R] Rodbc quesion: how to reliably determine the data type?

This is not a decision being made by RODBC... it is in the Microsoft ODBC driver for Excel. If you really want to know more, you can read http://www.dicks-blog.com/archives/2004/06/03/external-data-mixed-types/ ...

but the best solution is to take your data out of Excel and only use xls/xlsx formats for data output (if at all).


Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil_at_dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.

Hello,
>
>How can I tell RODBC to scan all the records of an xls file to determine the
>data type? If the first n records happen to be empty Rodbc assumes a character,
>and any numbers are made <NA>. And if, for instance, the first n records contain
>numbers, and later they also contain characters, those characters become NA.
>
> Cheers!!
>Albert-Jan
>
>
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>All right, but apart from the sanitation, the medicine, education, wine, public
>order, irrigation, roads, a fresh water system, and public health, what have the
>
>Romans ever done for us?
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> [[alternative HTML version deleted]]



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.
>

        [[alternative HTML version deleted]]



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 05 May 2011 - 06:25:10 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 05 May 2011 - 07:00:06 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