Skip to content

factor, as.factor and levels

2 messages · jim holtman, Heinz Tuechler

#
It is just a simple version of 'factor'.  The only speed advantage it
might have is that it checks to see if it is a factor first.  Here is
the definition:

)> as.factor
function (x)
if (is.factor(x)) x else factor(x)
<environment: namespace:base>

You can always list out what the function does to get a better
understanding of how it works.
On Wed, Apr 8, 2009 at 8:16 AM, Heinz Tuechler <tuechler at gmx.at> wrote:

  
    
#
Jim - you are right, I should have looked before. So there is a 
difference that should also effect the dropping of unused levels.

Thanks,

Heinz
At 15:31 08.04.2009, jim holtman wrote: