[R] Create a new Vector based on two columns

2012-04-25 Thread Patrick Hausmann
Hello, I am trying to get a new vector 'x1' based on the not NA-values in column 'a' and 'b'. I found a way but I am sure this is not the best solution. So any ideas on how to optimize this would be great! m - factor(c(a1, a1, a2, b1, b2, b3, d1, d1), ordered = TRUE) df - data.frame( a=

Re: [R] Create a new Vector based on two columns

2012-04-25 Thread Petr Savicky
On Wed, Apr 25, 2012 at 02:22:05PM +0200, Patrick Hausmann wrote: Hello, I am trying to get a new vector 'x1' based on the not NA-values in column 'a' and 'b'. I found a way but I am sure this is not the best solution. So any ideas on how to optimize this would be great! m -