From therneau at mayo.edu  Tue Mar 19 18:01:57 2013
From: therneau at mayo.edu (Terry Therneau)
Date: Tue, 19 Mar 2013 12:01:57 -0500
Subject: [Rd] numerics from a factor
In-Reply-To: <20808.37557.715432.547904@stat.math.ethz.ch>
References: <mailman.27.1363431608.4225.r-devel@r-project.org>
	<51445FB7.9090503@bht-berlin.de>
	<20808.37557.715432.547904@stat.math.ethz.ch>
Message-ID: <51489A05.6070408@mayo.edu>

Thanks Martin.  I had already changed the second argument to getOption.

By the way, per an off list comment from Brian R the bug I was addressing won't affect 
anyone using R as shipped; the default decimal separator is "." whatever the region.  It 
only bit those who set the OutDec option themselves.

Terry T.


On 03/19/2013 11:30 AM, Martin Maechler wrote:
>      >  Hi Terry, you can use type.convert instead of as.numeric
>      >  for numbers with decimals:
>
>      >  type.convert(levels(factor(1:6/2)),  dec=unlist(options("OutDec")))
>
>      >  Best, Ulrike
>
> a late and minor remark: If you use the above, a slightly more expressive
> preferred way is
>
>    type.convert(levels(factor(1:6/2)),  dec = getOption("OutDec"))
>
> Martin



[Rd] numerics from a factor
Terry Therneau