I was surprised to see that R will coerce factors into a number when concatenating vectors. This happens even when the levels are the same. For example:
>
Wow, I never realized it did that. Here is a work-around:
x <- c(facs[1 : 3], facs[4 : 5])
x <- factor(x, levels=1:nlevels(facs), labels=levels(facs))
x
With the output:
[1] i want to be a
Levels: a an be factor i integer not to want
It will only work if the two vectors have the same levels as here.