From ggrothendieck at gmail.com  Sat Apr 19 20:48:34 2014
From: ggrothendieck at gmail.com (Gabor Grothendieck)
Date: Sat, 19 Apr 2014 14:48:34 -0400
Subject: [Rd] type.convert and doubles
In-Reply-To: <A9466CB2-2B20-413D-986C-7EEC93CEC190@r-project.org>
References: <3736EC2D-7360-4AF6-BF96-5A2DF3D3EF14@warnes.net>
	<326FE12B-D6FE-471B-9E0C-10BEC0584DB7@r-project.org>
	<534860CC.2090206@gmail.com>
	<17B09E7789D3104E8F5EEB0582A8D66F0129CED9FD8C@MSGRTPCCRF2WIN.DMN1.FMR.COM>
	<CAECWziJq92keAD2sHHE7ky6CHhqatrBOONq_Vf18AHJ8GActZw@mail.gmail.com>
	<CAP01uRmdnTUgDH=sNryx9=w5Rtmw3b+8KiZOWPg48r6rc86ssQ@mail.gmail.com>
	<CAECWziKLBRjRNpneVJ2hNbTG3jF2ec6GeF9m+1S092WoufCdiQ@mail.gmail.com>
	<17B09E7789D3104E8F5EEB0582A8D66F0129CEDA0169@MSGRTPCCRF2WIN.DMN1.FMR.COM>
	<21330.29530.72292.435730@stat.math.ethz.ch>
	<A9466CB2-2B20-413D-986C-7EEC93CEC190@r-project.org>
Message-ID: <CAP01uRmvpGwQm31Lh8nVAysP-c1og+cHSFYROEGibNt1JejDPg@mail.gmail.com>

On Sat, Apr 19, 2014 at 1:06 PM, Simon Urbanek
<simon.urbanek at r-project.org> wrote:
> On Apr 19, 2014, at 9:00 AM, Martin Maechler <maechler at stat.math.ethz.ch> wrote:
>
> I think there should be two separate discussions:
>
> a) have an option (argument to type.convert and possibly read.table) to enable/disable this behavior. I'm strongly in favor of this.
>
> b) decide what the default for a) will be. I have no strong opinion, I can see arguments in both directions
>
> But most importantly I think a) is better than the status quo - even if the discussion about b) drags out.
>
> Cheers,
> Simon

Another possibility is:

(c) Return the column as factor/character but with a distinguishing
class so that the user can reset its class later. e.g.

DF <- read.table(...)
DF[] <- lapply(DF, function(x) if (inherits(x, "special.class"))
as.numeric(x) else x)

Personally I would go with (a) in both type.convert and read.table
with a default that reflects the historical behavior rather than the
current 3.1 behavior.


-- 
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com



[Rd] type.convert and doubles
Gabor Grothendieck