[Rd] numerics from a factor
Terry Therneau
therneau at mayo.edu
Tue Mar 19 18:01:57 CET 2013
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
More information about the R-devel
mailing list