Skip to content
Prev 53680 / 63421 Next

Simplify and By Convert Factors To Numeric Values

Good day,

It's not described anywhere in the help page, but tapply and by functions will, by default, convert factors into numeric values. Perhaps this needs to be documented or the behaviour changed.
1 2 3 
1 2 3

The documentation states "... tapply returns a multi-way array containing the values ..." but doesn't mention anything about converting factors into integers. I'd expect the values to be of the same type.

R version 3.4.0 (2017-04-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 8 (jessie)

Matrix products: default
BLAS: /dskh/nobackup/biostat/software/R-3.4.0/lib/libRblas.so
LAPACK: /dskh/nobackup/biostat/software/R-3.4.0/lib/libRlapack.so

--------------------------------------
Dario Strbenac
University of Sydney
Camperdown NSW 2050
Australia