Skip to content
Prev 878 / 63424 Next

tapply and factors in R-0.61

Somehow it seems that tapply converts factors given as the _first_
argument to a numerical representation without the old factor levels.
Worker   Machine     score 
"ordered"  "factor" "numeric"
Grouped Data: score ~ 1 | Worker
   Worker Machine score
1       1       A  52.0
2       1       A  52.8
3       1       A  53.1
4       2       A  51.8
5       2       A  52.8
6       2       A  53.1
7       3       A  60.0
8       3       A  60.2
9       3       A  58.4
10      4       A  51.1
$6
[1] 1 1 1 2 2 2 3 3 3

$2
[1] 1 1 1 2 2 2 3 3 3

$4
[1] 1 1 1 2 2 2 3 3 3

$1
[1] 1 1 1 2 2 2 3 3 3

$3
[1] 1 1 1 2 2 2 3 3 3

$5
[1] 1 1 1 2 2 2 3 3 3
6        2        4        1        3        5 
"factor" "factor" "factor" "factor" "factor" "factor"
$6
character(0)

$2
character(0)

$4
character(0)

$1
character(0)

$3
character(0)

$5
character(0)
[1] "A" "B" "C"

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._