[R] + and - in RODBC : no longer considered factors
dieter.menne at menne-biomed.de
Wed Apr 30 13:59:03 CEST 2008
Prof Brian Ripley <ripley <at> stats.ox.ac.uk> writes:
> It is nothing to do with RODBC, which follows read.table here:
> % cat > foo.txt
> > read.table("foo.txt", header=TRUE)
> 1 0
> 2 0
> and that uses
> > type.convert(c("+", "-"))
>  0 0
> > type.convert(c("+", "a"))
>  + a
> Levels: + a
Thank, Prof. Ripley, this makes sense as an explanation. So even
a = type.convert(c("+", "-"),as.is=TRUE)
# num [1:2] 0 0
does not help, because "num" bites first. Since the docs say
"convert it it to logical, integer, numeric or complex"
I would have expected this to be integer, but that's only of academic interest.
So the only workaround to make the large old code base to work is get the old
type.convert implementation and inject it.
More information about the R-help