Re: [R] Factor to numeric conversion - as.numeric(levels(f))[f] - Language definition seems to say to not use this.

2013-04-01 Thread Matthew Lundberg
is is OK, since this can change if the implementation > does. Which is the whole point, of course. > > -- Bert > > > > On Mon, Apr 1, 2013 at 12:16 PM, Matthew Lundberg > wrote: > > > > When used as an index, the factor is implicitly converted to integer. In >

Re: [R] Factor to numeric conversion - as.numeric(as.character(f))[f] - Language definition seems to say to not use this.

2013-04-01 Thread Matthew Lundberg
, Apr 1, 2013 at 1:49 PM, Peter Ehlers wrote: > On 2013-04-01 10:48, Matthew Lundberg wrote: > >> These two seem to be at odds. Is this the case? >> >> From help(factor) - section Warning: >>> >> >> To transform a factor f to approximately its origin

[R] Factor to numeric conversion - as.numeric(as.character(f))[f] - Language definition seems to say to not use this.

2013-04-01 Thread Matthew Lundberg
These two seem to be at odds. Is this the case? >From help(factor) - section Warning: To transform a factor f to approximately its original numeric values, as.numeric(levels(f))[f] is recommended and slightly more efficient than as.numeric(as.character(f)). >From the language definition - secti