Skip to content
Prev 32899 / 398513 Next

convert factor to numeric

On Wed, 4 Jun 2003, Prof Brian Ripley wrote:

            
There's also a consistency problem.  Suppose you have a factor
with levels(*)
   3163 2006 98195 98103  OX13DP

You really don't want to define as.numeric() so that its value for the
first four of these depends on whether the fifth is present.  So either
as.numeric() has to be NA for anything that can't be coerced to a number
or it needs something like its current definition.


	-thomas


(*) I'm not just being difficult.  These are postcodes I have had over the
past ten years or so.