Re: [R] change factor to mtrix

2013-06-12 Thread peter dalgaard
On Jun 12, 2013, at 09:47 , Gallon Li wrote: > i wish to change a column of factor variable to multiple columns of > zero-ones > > for example, my factor could be > > ff=c('a','a','b','b','c','c') > > then I want to have two columns (for three levels) that are > > 0 0 > 0 0 > 1 0 > 1 0 > 0 1

Re: [R] change factor to mtrix

2013-06-12 Thread Jim Lemon
On 06/12/2013 05:47 PM, Gallon Li wrote: i wish to change a column of factor variable to multiple columns of zero-ones for example, my factor could be ff=c('a','a','b','b','c','c') then I want to have two columns (for three levels) that are 0 0 0 0 1 0 1 0 0 1 0 1 how can i do this fast? H

[R] change factor to mtrix

2013-06-12 Thread Gallon Li
i wish to change a column of factor variable to multiple columns of zero-ones for example, my factor could be ff=c('a','a','b','b','c','c') then I want to have two columns (for three levels) that are 0 0 0 0 1 0 1 0 0 1 0 1 how can i do this fast? [[alternative HTML version deleted]]