Re: [R] Question about creating unique factor labels with the factor function

2005-07-20 Thread Peter Dalgaard
"Petr Pikal" <[EMAIL PROTECTED]> writes: > Hallo > > I am not sure what you want to achieve. > > your factor has 3 levels but with only 2 different labels > > > hb > [1] 1 1 1 1 1 1 2 2 2 > Levels: 1 1 2 > > but > > > str(hb) > Factor w/ 3 levels "1","1","2": 1 1 1 2 2 2 3 3 3 > > so you ga

Re: [R] Question about creating unique factor labels with the factor function

2005-07-20 Thread Petr Pikal
Hallo I am not sure what you want to achieve. your factor has 3 levels but with only 2 different labels > hb [1] 1 1 1 1 1 1 2 2 2 Levels: 1 1 2 but > str(hb) Factor w/ 3 levels "1","1","2": 1 1 1 2 2 2 3 3 3 so you gave only one label to level 1 and 2. You can give the same label to any le

[R] Question about creating unique factor labels with the factor function

2005-07-19 Thread Gregory Gentlemen
Hi guys, I ran into a problem of not being able to create unique labels when creating a factor. Consider an example below: hb <- factor(c(1,1,1,2,2,2,3,3,3), levels=c(1,2,3),labels=c(1,1,2)) > hb [1] 1 1 1 1 1 1 2 2 2 Levels: 1 1 2 > unique(hb) [1] 1 1 2 Levels: 1 1 2 How come there are thr