Skip to content
Prev 126016 / 398500 Next

Factor levels.

On 3/10/2007, at 5:48 PM, Peter Dalgaard wrote:

            
Yes it works.  What's the problem?

	To beat it to death:  if the second level of fff is absent then fff  
will consist entirely of 1's and 3's,
	and so c("U","A","S")[fff] will consist entirely of U's and S's.  I  
can then set the levels to be
	c("U","A","S") and get what I want.

	Note that if I just did

		fff <- factor(c("U","A","S")[fff])

	in these circumstances, then I would get a factor whose levels were c 
("U","S") which is NOT what I want.
	(I.e. I want the levels always to be c("U","A","S") irrespective of  
what levels are actually present in the factor.)
Right.  That is indeed sexier.  Thanks.

			cheers,

				Rolf

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