ベクトルを連結するときに、Rが因子を数値に強制変換するのを見て驚いた。これは、レベルが同じ場合でも発生します。例えば:
> facs <- as.factor(c("i", "want", "to", "be", "a", "factor", "not", "an", "integer"))
> facs
[1] i want to be a factor not an integer
Levels: a an be factor i integer not to want
> c(facs[1 : 3], facs[4 : 5])
[1] 5 9 8 3 1
Rでこれを行う慣用的な方法は何ですか(私の場合、これらのベクトルはかなり大きくなる可能性があります)?ありがとうございました。