[R] Need a factor level even though there are no observations

2005-05-08 Thread Ajay Narottam Shah
I'm in this situation: factorlabels - c(School, College, Beyond) with data for 8 families: education.man - c(1,2,1,2,1,2,1,2) # Note : no 3 values education.wife - c(1,2,3,1,2,3,1,2) # 1,2,3 are all present. My goal is to create this table:

RE: [R] Need a factor level even though there are no observations

2005-05-08 Thread falissard
PROTECTED] De la part de Ajay Narottam Shah Envoyé : dimanche 8 mai 2005 15:57 À : r-help Objet : [R] Need a factor level even though there are no observations I'm in this situation: factorlabels - c(School, College, Beyond) with data for 8 families: education.man - c(1,2,1,2,1,2,1,2

Re: [R] Need a factor level even though there are no observations

2005-05-08 Thread Prof Brian Ripley
Set levels not labels in the factor call. E.g. factor(School, levels = factorlabels) On Sun, 8 May 2005, Ajay Narottam Shah wrote: I'm in this situation: factorlabels - c(School, College, Beyond) with data for 8 families: education.man - c(1,2,1,2,1,2,1,2) # Note : no 3 values