[R] Catenating factors.

From: Rolf Turner <r.turner_at_auckland.ac.nz>
Date: Wed, 23 May 2007 13:38:19 +1200

I was recently asked by one of new colleagues how to combine, or catentate, or concatentate two factors. If x and y are factors, doing c(x,y) appears to coerce x and y to numeric mode before catenating them. So what does one do if one wants the result to be a factor whose levels are the union of the levels of x and y? I vaguely recall seeing this discussed in r-help, but I can't find anything on it there, nor in the FAQ.

Am I missing something obvious?

                    cheers,

                        Rolf
                        r.turner_at_auckland.ac.nz




######################################################################
Attention:\ This e-mail message is privileged and confidenti...{{dropped}}

R-help_at_stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 23 May 2007 - 01:44:46 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 23 May 2007 - 07:31:16 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.